@fishawack/lab-env 1.12.0 → 1.12.1

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.12.1 (2021-11-26)
4
+ * [Bug] Pass along errors thrown in new _.up function so commands correctly come to a stop when errors are thrown
5
+
3
6
  ### 1.12.0 (2021-11-17)
4
7
  * [Feature] Test for watertight-node-auto access
5
8
  * [Feature] Test for multiple ssh keys
package/commands/setup.js CHANGED
@@ -8,14 +8,7 @@ module.exports = [
8
8
  yargs => {},
9
9
  argv => {
10
10
  if(_.platform === "laravel" || _.platform === "wordpress" || _.platform === "drupal"){
11
- _.up(
12
- () => execSync(`source ${__dirname}/../intercept.sh && /bin/bash ./_Scripts/setup.sh`, _.opts),
13
- e => {
14
- if(e.status !== 130 && e.status !== 131 && e.status !== 1){
15
- console.log(e.message);
16
- }
17
- }
18
- );
11
+ _.up(() => execSync(`source ${__dirname}/../intercept.sh && /bin/bash ./_Scripts/setup.sh`, _.opts));
19
12
  } else {
20
13
  execSync(`${_.docker} ${_.run}c "npm run setup"`, _.opts);
21
14
  }
package/commands/start.js CHANGED
@@ -15,14 +15,7 @@ module.exports = [
15
15
  _.ports.get();
16
16
 
17
17
  if(_.platform === "laravel" || _.platform === "wordpress" || _.platform === "drupal"){
18
- _.up(
19
- () => execSync(`${_.docker} ${_.exec} core bash -lc "npm start -- -- ${argv.flags.join(' ')}" 2>/dev/null`, _.opts),
20
- e => {
21
- if(e.status !== 130 && e.status !== 131 && e.status !== 1){
22
- console.log(e);
23
- }
24
- }
25
- );
18
+ _.up(() => execSync(`${_.docker} ${_.exec} core bash -lc "npm start -- -- ${argv.flags.join(' ')}" 2>/dev/null`, _.opts));
26
19
  } else {
27
20
  execSync(`${_.docker} ${_.run}c "npm start -- -- ${argv.flags.join(' ')}" 2>/dev/null`, _.opts);
28
21
  }
package/globals.js CHANGED
@@ -100,15 +100,21 @@ module.exports = {
100
100
  process.env.PORT_DB = await getPort({port: getPort.makeRange(3306, 3406)});
101
101
  }
102
102
  } else {
103
- let env = execSync(`${docker} exec -T core env`, {encoding: 'utf8'});
104
- let ports = env.split('\n').reduce((obj, d) => { obj[d.split('=')[0]] = d.split('=')[1]; return obj; }, {});
103
+ try{
104
+ let env = execSync(`${docker} exec -T core env`, {encoding: 'utf8'});
105
+ let ports = env.split('\n').reduce((obj, d) => { obj[d.split('=')[0]] = d.split('=')[1]; return obj; }, {});
105
106
 
106
- process.env.PORT = ports.PORT;
107
- process.env.PORT_OPT = ports.PORT_OPT;
108
-
109
- if(platform === "laravel" || platform === "wordpress" || platform === "drupal"){
110
- process.env.PORT_WEB = ports.PORT_WEB;
111
- process.env.PORT_DB = ports.PORT_DB;
107
+ process.env.PORT = ports.PORT;
108
+ process.env.PORT_OPT = ports.PORT_OPT;
109
+
110
+ if(platform === "laravel" || platform === "wordpress" || platform === "drupal"){
111
+ process.env.PORT_WEB = ports.PORT_WEB;
112
+ process.env.PORT_DB = ports.PORT_DB;
113
+ }
114
+ } catch(e){
115
+ console.log(e.message);
116
+
117
+ process.exit(1);
112
118
  }
113
119
  }
114
120
  },
@@ -127,7 +133,7 @@ module.exports = {
127
133
  try{
128
134
  cb();
129
135
  } catch(e){
130
- if(err) err(e);
136
+ throw(e);
131
137
  } finally{
132
138
  if(!running) execSync(`lab-env down`, opts);
133
139
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishawack/lab-env",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "Docker manager for FW",
5
5
  "main": "cli.js",
6
6
  "scripts": {