Compare commits
2 Commits
960359e1e0
...
ef155d7eec
Author | SHA1 | Date |
---|---|---|
Josh Guyette | ef155d7eec | |
Josh Guyette | ab0f586bbe |
18
ngenv
18
ngenv
|
@ -39,7 +39,7 @@ function getOptions() {
|
||||||
if (options.verbose) console.log("Options:", options);
|
if (options.verbose) console.log("Options:", options);
|
||||||
|
|
||||||
// Find the .env file
|
// Find the .env file
|
||||||
const dotEnvFile = findDotEnv(options?.env ?? ".env");
|
const dotEnvFile = options?.env ?? findDotEnv(".env");
|
||||||
if (!dotEnvFile) {
|
if (!dotEnvFile) {
|
||||||
console.error(
|
console.error(
|
||||||
`The specified environment file was not found: ${options?.env ?? ".env"}`
|
`The specified environment file was not found: ${options?.env ?? ".env"}`
|
||||||
|
@ -113,20 +113,20 @@ function readNgrokConfig() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup the ngenv folder
|
// Setup the ngenv folder
|
||||||
const projectFolder = findProjectFolder(options?.env ?? ".env");
|
const tmpFolder = os.tmpdir();
|
||||||
if (!projectFolder) {
|
if (!tmpFolder) {
|
||||||
console.error(
|
console.error(
|
||||||
"No project folder found! Make sure there is a .env file in the project folder."
|
"No project folder found! Make sure there is a .env file in the project folder."
|
||||||
);
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
if (options.verbose) console.log(`Using project folder: ${projectFolder}`);
|
if (options.verbose) console.log(`Using project folder: ${tmpFolder}`);
|
||||||
if (!fs.existsSync(`${projectFolder}/.ngenv`)) {
|
if (!fs.existsSync(`${tmpFolder}/.ngenv`)) {
|
||||||
fs.mkdirSync(`${projectFolder}/.ngenv`);
|
fs.mkdirSync(`${tmpFolder}/.ngenv`);
|
||||||
}
|
}
|
||||||
const lockFile = `${projectFolder}/.ngenv/running.lock`;
|
const lockFile = `${tmpFolder}/.ngenv/running.lock`;
|
||||||
const outLogFile = `${projectFolder}/.ngenv/out.log`;
|
const outLogFile = `${tmpFolder}/.ngenv/out.log`;
|
||||||
const errLogFile = `${projectFolder}/.ngenv/err.log`;
|
const errLogFile = `${tmpFolder}/.ngenv/err.log`;
|
||||||
|
|
||||||
/******************************************* Startup *******************************************/
|
/******************************************* Startup *******************************************/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ngenv",
|
"name": "ngenv",
|
||||||
"version": "2.0.3",
|
"version": "2.0.4",
|
||||||
"description": "Writes ngrok tunnel url to .env file",
|
"description": "Writes ngrok tunnel url to .env file",
|
||||||
"main": "ngenv",
|
"main": "ngenv",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
Loading…
Reference in New Issue