move child_process import to top

This commit is contained in:
RealBeepMcJeep 2023-08-29 14:05:18 -07:00
parent 01ff9604bd
commit 2bd645e271
2 changed files with 23 additions and 2 deletions

16
jsconfig.json Normal file
View File

@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "ESNext",
"target": "ESNext",
"moduleResolution": "node",
"strictNullChecks": true,
"strictFunctionTypes": true,
"checkJs": true,
"allowUmdGlobalAccess": true,
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules",
"**/node_modules/*"
]
}

View File

@ -1,5 +1,9 @@
#!/usr/bin/env node #!/usr/bin/env node
// native node modules
const child_process = require('child_process')
createDefaultFiles(); createDefaultFiles();
function createDefaultFiles() { function createDefaultFiles() {
@ -838,11 +842,11 @@ function getVersion() {
const pkgJson = require('./package.json'); const pkgJson = require('./package.json');
pkgVersion = pkgJson.version; pkgVersion = pkgJson.version;
if (!process.pkg && commandExistsSync('git')) { if (!process.pkg && commandExistsSync('git')) {
gitRevision = require('child_process') gitRevision = child_process
.execSync('git rev-parse --short HEAD', { cwd: process.cwd(), stdio: ['ignore', 'pipe', 'ignore'] }) .execSync('git rev-parse --short HEAD', { cwd: process.cwd(), stdio: ['ignore', 'pipe', 'ignore'] })
.toString().trim(); .toString().trim();
gitBranch = require('child_process') gitBranch = child_process
.execSync('git rev-parse --abbrev-ref HEAD', { cwd: process.cwd(), stdio: ['ignore', 'pipe', 'ignore'] }) .execSync('git rev-parse --abbrev-ref HEAD', { cwd: process.cwd(), stdio: ['ignore', 'pipe', 'ignore'] })
.toString().trim(); .toString().trim();
} }
@ -1855,6 +1859,7 @@ app.post("/getstatus_novelai", jsonParser, function (request, response_getstatus
data: data, data: data,
headers: { "Content-Type": "application/json", "Authorization": "Bearer " + api_key_novel } headers: { "Content-Type": "application/json", "Authorization": "Bearer " + api_key_novel }
}; };
client.get(api_novelai + "/user/subscription", args, function (data, response) { client.get(api_novelai + "/user/subscription", args, function (data, response) {
if (response.statusCode == 200) { if (response.statusCode == 200) {
//console.log(data); //console.log(data);