@fishawack/lab-env 4.3.0 → 4.3.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,9 @@
1
1
  ## Changelog
2
2
 
3
+ ### 4.3.1 (2022-11-14)
4
+ * [Bug] key and dekey can now be run outside of repos
5
+ * [Bug] Use repo_safe for all compose commands
6
+
3
7
  ### 4.3.0 (2022-11-09)
4
8
  * [Feature] Added newly setup AWS accounts to the client prompts on `fw provision`
5
9
  * [Feature] Laravels php and nginx images are now versioned
package/globals.js CHANGED
@@ -46,6 +46,8 @@ try{
46
46
  repo = path.basename(process.cwd());
47
47
  }
48
48
 
49
+ const repo_safe = repo.replace(/\./g, '');
50
+
49
51
  try{ pkg = require(path.join(process.cwd(), 'package.json')); } catch(e){}
50
52
 
51
53
  try{ composer = require(path.join(process.cwd(), 'composer.json')); } catch(e){}
@@ -104,27 +106,27 @@ if(platform === 'laravel'){
104
106
  container = `-f ${__dirname}/laravel/8/docker-compose-dev.yml ${container}`;
105
107
  }
106
108
 
107
- docker = `docker-compose --env-file ${path.join(process.cwd(), '.env')} ${container} ${core} -p ${repo}`;
109
+ docker = `docker-compose --env-file ${path.join(process.cwd(), '.env')} ${container} ${core} -p ${repo_safe}`;
108
110
  } else if(platform === 'wordpress'){
109
111
  if(!existsSync(path.join(process.cwd(), '.env'))){
110
112
  copyFileSync(path.join(process.cwd(), '.env.example'), path.join(process.cwd(), '.env'));
111
113
  }
112
114
 
113
- docker = `docker-compose --env-file ${path.join(process.cwd(), '.env')} -f ${__dirname}/wordpress/5.7.2/docker-compose.yml ${core} -p ${repo}`;
115
+ docker = `docker-compose --env-file ${path.join(process.cwd(), '.env')} -f ${__dirname}/wordpress/5.7.2/docker-compose.yml ${core} -p ${repo_safe}`;
114
116
  } else if(platform === "drupal"){
115
117
  if(!existsSync(path.join(process.cwd(), '.env'))){
116
118
  copyFileSync(path.join(process.cwd(), '.env.example'), path.join(process.cwd(), '.env'));
117
119
  }
118
120
 
119
- docker = `docker-compose --env-file ${path.join(process.cwd(), '.env')} -f ${__dirname}/drupal/9/docker-compose.yml ${core} -p ${repo}`;
121
+ docker = `docker-compose --env-file ${path.join(process.cwd(), '.env')} -f ${__dirname}/drupal/9/docker-compose.yml ${core} -p ${repo_safe}`;
120
122
  } else if(platform === "craftcms"){
121
123
  if(!existsSync(path.join(process.cwd(), '.env'))){
122
124
  copyFileSync(path.join(process.cwd(), '.env.example'), path.join(process.cwd(), '.env'));
123
125
  }
124
126
 
125
- docker = `docker-compose --env-file ${path.join(process.cwd(), '.env')} -f ${__dirname}/craftcms/3/docker-compose.yml ${core} -p ${repo}`;
127
+ docker = `docker-compose --env-file ${path.join(process.cwd(), '.env')} -f ${__dirname}/craftcms/3/docker-compose.yml ${core} -p ${repo_safe}`;
126
128
  } else {
127
- docker = `docker-compose ${core} -p ${repo}`;
129
+ docker = `docker-compose ${core} -p ${repo_safe}`;
128
130
  }
129
131
 
130
132
  try{
@@ -135,8 +137,8 @@ try{
135
137
  run = `${method} core bash -l`;
136
138
  } catch(e){}
137
139
 
138
- // Always allow diagnose, diag, version, help and origin through
139
- if(args[0] !== 'diag' && args[0] !== 'diagnose' && args[0] !== 'origin' && args[0] !== '--version' && args[0] !== '--help' && args[0] !== 'new'){
140
+ // Always allow commands that don't require a repository through
141
+ if(args[0] !== 'diag' && args[0] !== 'diagnose' && args[0] !== 'origin' && args[0] !== '--version' && args[0] !== '--help' && args[0] !== 'new' && args[0] !== 'key' && args[0] !== 'dekey'){
140
142
  // Stop here if diagnosis either unset or outdated
141
143
  if(!config.diagnosis || semver.diff(config.diagnosis, diagnosis) === 'major'){
142
144
  console.log(`${utilities.colorize(`@fishawack/lab-env`, 'title')} diagnosis is ${utilities.colorize(`outdated`, 'error')}.\n\nRun ${utilities.colorize(`fw diagnose`, 'success')} to reconfigure.`);
@@ -158,7 +160,7 @@ module.exports = {
158
160
  platform,
159
161
  repo,
160
162
  branch,
161
- repo_safe: repo.replace(/\./g, ''),
163
+ repo_safe,
162
164
  pkg,
163
165
  docker,
164
166
  method,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishawack/lab-env",
3
- "version": "4.3.0",
3
+ "version": "4.3.1",
4
4
  "description": "Docker manager for FW",
5
5
  "main": "cli.js",
6
6
  "scripts": {