forked from clerk/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
26 lines (24 loc) · 653 Bytes
/
Copy pathconfig.js
File metadata and controls
26 lines (24 loc) · 653 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { spawn } from 'node:child_process';
import { CONFIG_FILE } from '../utils/getConfiguration.js';
/**
* Opens the clerk-dev config file in VISUAL or EDITOR.
*/
export async function config() {
if (process.env.VISUAL) {
spawn(process.env.VISUAL, [CONFIG_FILE], {
stdio: 'inherit',
env: {
...process.env,
},
});
} else if (process.env.EDITOR) {
spawn(process.env.EDITOR, [CONFIG_FILE], {
stdio: 'inherit',
env: {
...process.env,
},
});
} else {
console.error(`Unable to open clerk-dev config file. Make sure the EDITOR or VISUAL environment variable is set.`);
}
}