@fishawack/lab-env 1.15.0 → 1.16.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/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## Changelog
2
2
 
3
+ ### 1.16.0 (2022-01-25)
4
+ * [Feature] lab-env now checks if docker process is running. Only `origin` and `--version` commands allowed if not
5
+
3
6
  ### 1.15.0 (2022-01-17)
4
7
  * [Feature] Docker images are now pulled from docker hub if lab-env not running with devDependencies installed
5
8
  * [Feature] Added a package.json to the core package in lab-env for more streamlined docker hub publishes
package/cli.js CHANGED
@@ -15,6 +15,9 @@ const { hideBin } = require('yargs/helpers');
15
15
 
16
16
  const args = hideBin(process.argv);
17
17
 
18
+ // Stop here if docker process not running and command isn't version or origin which don't require docker
19
+ if(!_.services && !(args[0] === 'origin' || args[0] === '--version')) return;
20
+
18
21
  (async () => {
19
22
  process.env.REPO = _.repo;
20
23
 
package/globals.js CHANGED
@@ -82,13 +82,18 @@ if(platform === 'laravel'){
82
82
  docker = `docker-compose ${core} -p ${repo}`;
83
83
  }
84
84
 
85
- services = execSync(`${docker} ps --services --filter "status=running"`, {encoding: 'utf8'});
86
- running = services.trim().length;
87
- exec = `exec ${process.env.CI_BUILD_ID ? '-T' : ''}`;
88
- method = running ? exec : 'run --rm --service-ports';
89
- run = `${method} core bash -l`;
85
+ try{
86
+ services = execSync(`${docker} ps --services --filter "status=running" 2>/dev/null`, {encoding: 'utf8'});
87
+ running = services.trim().length;
88
+ exec = `exec ${process.env.CI_BUILD_ID ? '-T' : ''}`;
89
+ method = running ? exec : 'run --rm --service-ports';
90
+ run = `${method} core bash -l`;
91
+ } catch(e){
92
+ console.log("Docker does not appear to be running...");
93
+ }
90
94
 
91
95
  module.exports = {
96
+ services,
92
97
  platform,
93
98
  repo,
94
99
  repo_safe: repo.replace(/\./g, ''),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishawack/lab-env",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "description": "Docker manager for FW",
5
5
  "main": "cli.js",
6
6
  "scripts": {