Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3248337
D5267.id17247.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
653 B
Referenced Files
None
Subscribers
None
D5267.id17247.diff
View Options
diff --git a/keyserver/src/utils/import-json.js b/keyserver/src/utils/import-json.js
--- a/keyserver/src/utils/import-json.js
+++ b/keyserver/src/utils/import-json.js
@@ -1,5 +1,7 @@
// @flow
+import fs from 'fs';
+
type ConfigName = {
+folder: 'secrets' | 'facts',
+name: string,
@@ -42,10 +44,9 @@
}
const path = getPathForConfigName(configName);
try {
- // $FlowFixMe
- const importedJSON = await import(`../../${path}`);
- return importedJSON.default;
- } catch {
+ return JSON.parse(fs.readFileSync(path, 'utf8'));
+ } catch (e) {
+ console.log(`Failed to read JSON from ${path}`, e);
return null;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 9:26 AM (22 h, 48 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2497128
Default Alt Text
D5267.id17247.diff (653 B)
Attached To
Mode
D5267: [keyserver] Update importJSON to use fs instead of import
Attached
Detach File
Event Timeline
Log In to Comment