@leverege/build-tools 2.36.0 → 2.36.2

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.
@@ -38,7 +38,11 @@ const INTERACTIVE_MODE = !TARGET;
38
38
  let exited = false;
39
39
  const SECRETS_DIR = 'secrets';
40
40
  const EXIT_EVENTS = ['SIGINT', 'exit', 'uncaughException', 'unhandledRejection'];
41
- const [firebaserc, firebaseJson, git] = await Promise.all([_zx.fs.exists(_zx.path.join(process.cwd(), '.firebaserc')), _zx.fs.exists(_zx.path.join(process.cwd(), 'firebase.json')), _zx.fs.exists(_zx.path.join(process.cwd(), '.git/HEAD'))]);
41
+ const [firebaserc, firebaseJson, gitBranch] = await Promise.all([_zx.fs.exists(_zx.path.join(process.cwd(), '.firebaserc')), _zx.fs.exists(_zx.path.join(process.cwd(), 'firebase.json')), (0, _zx.$)`git rev-parse --abbrev-ref HEAD -C ${process.cwd()}`.then(({
42
+ stdout
43
+ }) => {
44
+ return stdout.split('\n')[0];
45
+ })]);
42
46
  if (!firebaserc) {
43
47
  console.log(_zx.chalk.red('No .firebaserc file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.'));
44
48
  }
@@ -51,18 +55,6 @@ if (!firebaserc || !firebaseJson) {
51
55
  const firebasercContent = JSON.parse(await _zx.fs.readFile(_zx.path.join(process.cwd(), '.firebaserc'), {
52
56
  encoding: 'utf-8'
53
57
  }));
54
-
55
- // If in a git repo, fetch the name of the git branch to use as a default
56
- // name in case a deployment channel is needed. Examining this file directly
57
- // is less cumbersome then running an actual git command to fetch the
58
- // branch name
59
- let gitBranch;
60
- if (git) {
61
- const gitContent = (await _zx.fs.readFile(_zx.path.join(process.cwd(), '.git/HEAD'), {
62
- encoding: 'utf-8'
63
- }))?.split('/');
64
- gitBranch = gitContent[gitContent?.length - 1]?.trimEnd('\n');
65
- }
66
58
  let maxSiteIdLength = 0;
67
59
  const targets = Object.entries(firebasercContent.targets).reduce((prev, [projectId, config]) => {
68
60
  Object.entries(config.hosting).forEach(([siteId, aliases]) => {
@@ -38,7 +38,11 @@ const INTERACTIVE_MODE = !TARGET;
38
38
  let exited = false;
39
39
  const SECRETS_DIR = 'secrets';
40
40
  const EXIT_EVENTS = ['SIGINT', 'exit', 'uncaughException', 'unhandledRejection'];
41
- const [firebaserc, firebaseJson, git] = await Promise.all([_zx.fs.exists(_zx.path.join(process.cwd(), '.firebaserc')), _zx.fs.exists(_zx.path.join(process.cwd(), 'firebase.json')), _zx.fs.exists(_zx.path.join(process.cwd(), '.git/HEAD'))]);
41
+ const [firebaserc, firebaseJson, gitBranch] = await Promise.all([_zx.fs.exists(_zx.path.join(process.cwd(), '.firebaserc')), _zx.fs.exists(_zx.path.join(process.cwd(), 'firebase.json')), (0, _zx.$)`git rev-parse --abbrev-ref HEAD -C ${process.cwd()}`.then(({
42
+ stdout
43
+ }) => {
44
+ return stdout.split('\n')[0];
45
+ })]);
42
46
  if (!firebaserc) {
43
47
  console.log(_zx.chalk.red('No .firebaserc file found. Make sure that you are executing firebaseDeploy from within a firebase project directory.'));
44
48
  }
@@ -51,18 +55,6 @@ if (!firebaserc || !firebaseJson) {
51
55
  const firebasercContent = JSON.parse(await _zx.fs.readFile(_zx.path.join(process.cwd(), '.firebaserc'), {
52
56
  encoding: 'utf-8'
53
57
  }));
54
-
55
- // If in a git repo, fetch the name of the git branch to use as a default
56
- // name in case a deployment channel is needed. Examining this file directly
57
- // is less cumbersome then running an actual git command to fetch the
58
- // branch name
59
- let gitBranch;
60
- if (git) {
61
- const gitContent = (await _zx.fs.readFile(_zx.path.join(process.cwd(), '.git/HEAD'), {
62
- encoding: 'utf-8'
63
- }))?.split('/');
64
- gitBranch = gitContent[gitContent?.length - 1]?.trimEnd('\n');
65
- }
66
58
  let maxSiteIdLength = 0;
67
59
  const targets = Object.entries(firebasercContent.targets).reduce((prev, [projectId, config]) => {
68
60
  Object.entries(config.hosting).forEach(([siteId, aliases]) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.36.0",
3
+ "version": "2.36.2",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
package/src/dockreate CHANGED
@@ -392,7 +392,7 @@ rm -rf ./workspace && mkdir -p ./workspace
392
392
  cp -rfp ${PKGTOP}/package*json ${PKGTOP}/dist/* ./workspace
393
393
 
394
394
  # grab the npmrc token for the image
395
- cp -f "$HOME/.npmrc.ro" .npmrc
395
+ cp -f "$HOME/.npmrc" .npmrc
396
396
 
397
397
  [ "$CIRCLECI" == "true" ] && exit 0
398
398
 
@@ -42,11 +42,14 @@ const EXIT_EVENTS = [ 'SIGINT', 'exit', 'uncaughException', 'unhandledRejection'
42
42
  const [
43
43
  firebaserc,
44
44
  firebaseJson,
45
- git
45
+ gitBranch
46
46
  ] = await Promise.all( [
47
47
  fs.exists( path.join( process.cwd(), '.firebaserc' ) ),
48
48
  fs.exists( path.join( process.cwd(), 'firebase.json' ) ),
49
- fs.exists( path.join( process.cwd(), '.git/HEAD' ) )
49
+ $`git rev-parse --abbrev-ref HEAD -C ${process.cwd()}`
50
+ .then( ( { stdout } ) => {
51
+ return stdout.split( '\n' )[0]
52
+ } )
50
53
  ] )
51
54
 
52
55
  if ( !firebaserc ) {
@@ -63,16 +66,6 @@ if ( !firebaserc || !firebaseJson ) {
63
66
 
64
67
  const firebasercContent = JSON.parse( await fs.readFile( path.join( process.cwd(), '.firebaserc' ), { encoding : 'utf-8' } ) )
65
68
 
66
- // If in a git repo, fetch the name of the git branch to use as a default
67
- // name in case a deployment channel is needed. Examining this file directly
68
- // is less cumbersome then running an actual git command to fetch the
69
- // branch name
70
- let gitBranch
71
- if ( git ) {
72
- const gitContent = ( await fs.readFile( path.join( process.cwd(), '.git/HEAD' ), { encoding : 'utf-8' } ) )?.split( '/' )
73
- gitBranch = gitContent[gitContent?.length - 1]?.trimEnd( '\n' )
74
- }
75
-
76
69
  let maxSiteIdLength = 0
77
70
 
78
71
  const targets = Object
package/src/helmdn CHANGED
@@ -92,6 +92,17 @@ function annihilateVelero() {
92
92
  }
93
93
 
94
94
  function helmDown() {
95
+ if [ -f "$1/.nohelmdn" ];
96
+ then
97
+ cat<<NOHELMDN
98
+ `color r "***ERROR: $1/.nohelmdn blocker detect - helmdn blocked"`
99
+
100
+ Somebody really doesn't want you to helmdn $1
101
+
102
+ NOHELMDN
103
+ exit 1
104
+ fi
105
+
95
106
  local namespace=${2:-default}
96
107
  local helmdn="helm uninstall $1 -n $namespace"
97
108
  eval $helmdn