change environment properly

This commit is contained in:
Evert Prants 2020-12-07 20:49:44 +02:00
parent 3ec1800883
commit 7bccb06f60
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
3 changed files with 6 additions and 4 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@squeebot/cli",
"version": "3.0.0",
"version": "3.0.0-1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@squeebot/cli",
"version": "3.0.0",
"version": "3.0.1",
"description": "Squeebot v3 runtime, environments and configuration",
"main": "dist/squeebot.js",
"bin": {
@ -29,7 +29,7 @@
"typescript": "^4.0.5"
},
"dependencies": {
"@squeebot/core": "^3.0.0",
"@squeebot/core": "^3.0.1",
"fs-extra": "^9.0.1",
"node-watch": "^0.7.0",
"tar": "^6.0.5",

View File

@ -1,5 +1,4 @@
#!/usr/bin/env node
import * as fs from 'fs-extra';
import * as path from 'path';
import readline from 'readline';
import yargs from 'yargs';
@ -28,6 +27,9 @@ async function start(argv: any): Promise<void> {
const enviroFile = path.resolve(process.cwd(), argv.environment);
const env: IEnvironment = await loadEnvironment(argv.environment, root);
// Change working directory to the environment
process.chdir(env.path as string);
const sb = new Squeebot(env);
await sb.initialize(argv.e !== true);