diff --git a/index.js b/index.js deleted file mode 100644 index 0d58f3c..0000000 --- a/index.js +++ /dev/null @@ -1,39 +0,0 @@ -const { spawnSync } = require('child_process') -const { existsSync, writeFileSync } = require('fs') - -const SESSION_ID = 'levanter_148eae7c7669b148fabcb31be926df702f' // Edit this line only, don't remove ' <- this symbol - -if (!existsSync('levanter')) { - console.log('Cloning the repository...') - const cloneResult = spawnSync( - 'git', - ['clone', 'https://github.com/lyfe00011/levanter.git', 'levanter'], - { - stdio: 'inherit', - } - ) - - if (cloneResult.error) { - throw new Error(`Failed to clone the repository: ${cloneResult.error.message}`) - } - - const configPath = 'levanter/config.env' - try { - console.log('Writing to config.env...') - writeFileSync(configPath, `VPS=true\nSESSION_ID=${SESSION_ID}`) - } catch (err) { - throw new Error(`Failed to write to config.env: ${err.message}`) - } - - console.log('Installing dependencies...') - const installResult = spawnSync('yarn', ['install', '--network-concurrency', '3'], { - cwd: 'levanter', - stdio: 'inherit', - }) - - if (installResult.error) { - throw new Error(`Failed to install dependencies: ${installResult.error.message}`) - } -} - -spawnSync('yarn', ['start'], { cwd: 'levanter', stdio: 'inherit' })