Merge pull request #29 from werf/output_dotenv_instead_of_catting_source_file

Output envs loaded by the dotenv instead of printing a source file content
This commit is contained in:
Alexey Igrychev
2021-03-18 16:14:43 -01:00
committed by GitHub
7 changed files with 14 additions and 64 deletions

View File

@@ -43843,15 +43843,8 @@ class Manager {
const tmpFile = tmp.fileSync(); const tmpFile = tmp.fileSync();
const tmpFilePath = tmpFile.name; const tmpFilePath = tmpFile.name;
yield this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath]); yield this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath]);
dotenv.config({ path: tmpFilePath }); const res = dotenv.config({ path: tmpFilePath });
fs.readFile(tmpFilePath, null, function (err, contents) { console.log(res.parsed);
if (err) {
console.error(err);
}
else {
console.log(contents.toString());
}
});
tmpFile.removeCallback(); tmpFile.removeCallback();
}); });
} }

View File

@@ -43843,15 +43843,8 @@ class Manager {
const tmpFile = tmp.fileSync(); const tmpFile = tmp.fileSync();
const tmpFilePath = tmpFile.name; const tmpFilePath = tmpFile.name;
yield this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath]); yield this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath]);
dotenv.config({ path: tmpFilePath }); const res = dotenv.config({ path: tmpFilePath });
fs.readFile(tmpFilePath, null, function (err, contents) { console.log(res.parsed);
if (err) {
console.error(err);
}
else {
console.log(contents.toString());
}
});
tmpFile.removeCallback(); tmpFile.removeCallback();
}); });
} }

View File

@@ -43844,15 +43844,8 @@ class Manager {
const tmpFile = tmp.fileSync(); const tmpFile = tmp.fileSync();
const tmpFilePath = tmpFile.name; const tmpFilePath = tmpFile.name;
yield this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath]); yield this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath]);
dotenv.config({ path: tmpFilePath }); const res = dotenv.config({ path: tmpFilePath });
fs.readFile(tmpFilePath, null, function (err, contents) { console.log(res.parsed);
if (err) {
console.error(err);
}
else {
console.log(contents.toString());
}
});
tmpFile.removeCallback(); tmpFile.removeCallback();
}); });
} }

View File

@@ -43844,15 +43844,8 @@ class Manager {
const tmpFile = tmp.fileSync(); const tmpFile = tmp.fileSync();
const tmpFilePath = tmpFile.name; const tmpFilePath = tmpFile.name;
yield this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath]); yield this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath]);
dotenv.config({ path: tmpFilePath }); const res = dotenv.config({ path: tmpFilePath });
fs.readFile(tmpFilePath, null, function (err, contents) { console.log(res.parsed);
if (err) {
console.error(err);
}
else {
console.log(contents.toString());
}
});
tmpFile.removeCallback(); tmpFile.removeCallback();
}); });
} }

View File

@@ -43962,15 +43962,8 @@ class Manager {
const tmpFile = tmp.fileSync(); const tmpFile = tmp.fileSync();
const tmpFilePath = tmpFile.name; const tmpFilePath = tmpFile.name;
yield this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath]); yield this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath]);
dotenv.config({ path: tmpFilePath }); const res = dotenv.config({ path: tmpFilePath });
fs.readFile(tmpFilePath, null, function (err, contents) { console.log(res.parsed);
if (err) {
console.error(err);
}
else {
console.log(contents.toString());
}
});
tmpFile.removeCallback(); tmpFile.removeCallback();
}); });
} }

View File

@@ -43916,15 +43916,8 @@ class Manager {
const tmpFile = tmp.fileSync(); const tmpFile = tmp.fileSync();
const tmpFilePath = tmpFile.name; const tmpFilePath = tmpFile.name;
yield this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath]); yield this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath]);
dotenv.config({ path: tmpFilePath }); const res = dotenv.config({ path: tmpFilePath });
fs.readFile(tmpFilePath, null, function (err, contents) { console.log(res.parsed);
if (err) {
console.error(err);
}
else {
console.log(contents.toString());
}
});
tmpFile.removeCallback(); tmpFile.removeCallback();
}); });
} }

View File

@@ -62,16 +62,8 @@ export class Manager {
const tmpFile = tmp.fileSync() const tmpFile = tmp.fileSync()
const tmpFilePath = tmpFile.name const tmpFilePath = tmpFile.name
await this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath]) await this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath])
dotenv.config({path: tmpFilePath}) const res = dotenv.config({path: tmpFilePath})
console.log(res.parsed)
fs.readFile(tmpFilePath, null, function(err, contents) {
if (err) {
console.error(err)
} else {
console.log(contents.toString())
}
})
tmpFile.removeCallback() tmpFile.removeCallback()
} }