@agilecustoms/envctl 1.10.4 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/container.js CHANGED
@@ -13,7 +13,8 @@ export function buildContainer(appVersion) {
13
13
  const httpClient = new HttpClient(appVersion, commandId);
14
14
  const envApiClient = new EnvApiClient(httpClient);
15
15
  const localStateService = new LocalStateService();
16
- const terraformAdapter = new TerraformAdapter(Date.now, cli, localStateService, backends);
16
+ const nonInteractive = !process.stdout.isTTY || process.env.CI === 'true';
17
+ const terraformAdapter = new TerraformAdapter(Date.now, cli, localStateService, backends, nonInteractive);
17
18
  const envService = new EnvService(cli, envApiClient, terraformAdapter);
18
19
  const logService = new LogService(cli, envApiClient, terraformAdapter);
19
20
  return { configService, envService, logService };
@@ -19,12 +19,14 @@ export class TerraformAdapter {
19
19
  now;
20
20
  cli;
21
21
  localStateService;
22
+ nonInteractive;
22
23
  backends;
23
24
  backend = undefined;
24
- constructor(now, cli, localStateService, backends) {
25
+ constructor(now, cli, localStateService, backends, nonInteractive) {
25
26
  this.now = now;
26
27
  this.cli = cli;
27
28
  this.localStateService = localStateService;
29
+ this.nonInteractive = nonInteractive;
28
30
  this.backends = backends.reduce((acc, backend) => {
29
31
  acc.set(backend.getType(), backend);
30
32
  return acc;
@@ -130,6 +132,9 @@ export class TerraformAdapter {
130
132
  extraArgs.push('-var=' + key + '=' + value);
131
133
  }
132
134
  });
135
+ if (this.nonInteractive && !args.some(arg => arg.startsWith('-input'))) {
136
+ extraArgs.push('-input=false');
137
+ }
133
138
  return [...extraArgs, ...args];
134
139
  }
135
140
  getVarDefs() {
package/dist/util.js CHANGED
@@ -1,6 +1,7 @@
1
- export function toLocalTime(ttl) {
1
+ export function toLocalTime(ttl, timeZone) {
2
2
  const date = new Date(ttl * 1000);
3
- return date.toLocaleString(undefined, {
3
+ return date.toLocaleString('en-US', {
4
+ timeZone,
4
5
  month: 'short',
5
6
  day: '2-digit',
6
7
  hour: '2-digit',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilecustoms/envctl",
3
- "version": "1.10.4",
3
+ "version": "1.11.0",
4
4
  "description": "node.js CLI client for manage environments",
5
5
  "keywords": [
6
6
  "terraform wrapper",