@idearium/cli
Advanced tools
Comparing version 1.0.0-alpha.6 to 1.0.0-alpha.7
@@ -23,8 +23,12 @@ #!/usr/bin/env node | ||
// Load the current configuration, so we don't loose any previous values. | ||
const locals = dotenv.config(); | ||
// Setup the locals. | ||
// Load the defaults first. | ||
const defaults = dotenv.config({ path: path.join(projectRoot, 'devops', 'templates', '.env.defaults') }).parsed; | ||
// Set the default value for `COMPOSE_FILE`. | ||
locals.COMPOSE_FILE = 'docker-compose.yml'; | ||
// Update the defaults with the current configuration. | ||
const locals = Object.assign({}, defaults, dotenv.config().parsed); | ||
// Reset the COMPOSE_FILE value. | ||
locals.COMPOSE_FILE = defaults.COMPOSE_FILE; | ||
// Let's determine if the file exists first. | ||
@@ -31,0 +35,0 @@ if (value !== 'reset') { |
@@ -5,4 +5,24 @@ # @ideariym/cli | ||
## 1.0.0-alpha.5 | ||
## 1.0.0-alpha.7 | ||
Improvements. | ||
### Improvements | ||
- `c dc env file` now requires you provide, in addition to `./devops/templates/.env.tmpl` a `./devops/templates/.env.defaults` file, for a list of default values to provide to the template. Example files below. | ||
**`.env.tmpl`** | ||
``` | ||
COMPOSE_PROJECT_NAME={{COMPOSE_PROJECT_NAME}} | ||
COMPOSE_FILE={{COMPOSE_FILE}} | ||
``` | ||
**`.env.defaults`** | ||
``` | ||
COMPOSE_PROJECT_NAME=cp | ||
COMPOSE_FILE=docker-compose.yml | ||
``` | ||
## 1.0.0-alpha.6 | ||
New commands. | ||
@@ -9,0 +29,0 @@ |
{ | ||
"name": "@idearium/cli", | ||
"version": "1.0.0-alpha.6", | ||
"version": "1.0.0-alpha.7", | ||
"description": "The Idearium cli, which makes working with our projects much easier.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
16173
307