@leverege/build-tools 2.24.0 → 2.24.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/.vscode/launch.json +29 -0
- package/lib/server/unleash.js +10 -2
- package/lib/web/unleash.js +10 -2
- package/package.json +1 -1
- package/src/unleash.js +13 -2
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"type": "node",
|
|
9
|
+
"request": "launch",
|
|
10
|
+
"name": "firebase deploy",
|
|
11
|
+
"skipFiles": [
|
|
12
|
+
"<node_internals>/**"
|
|
13
|
+
],
|
|
14
|
+
"program": "${workspaceFolder}/src/firebaseDeploy.mjs",
|
|
15
|
+
"console": "integratedTerminal"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "node",
|
|
19
|
+
"request": "launch",
|
|
20
|
+
"name": "unleash",
|
|
21
|
+
"skipFiles": [
|
|
22
|
+
"<node_internals>/**"
|
|
23
|
+
],
|
|
24
|
+
"program": "${workspaceFolder}/src/unleash.js",
|
|
25
|
+
"args": [ "unleasb","unleash-flex" ],
|
|
26
|
+
"console": "integratedTerminal"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
package/lib/server/unleash.js
CHANGED
|
@@ -14,9 +14,17 @@ const getCurrentBranchName = async () => {
|
|
|
14
14
|
return Object.entries(branchInfo.branches).find(([name, info]) => info.current)[0];
|
|
15
15
|
};
|
|
16
16
|
const isProtected = async () => {
|
|
17
|
-
const protectedBranches = ['main', 'master', 'development', ...process.argv.slice(2)];
|
|
18
17
|
const theBranch = await getCurrentBranchName();
|
|
19
|
-
|
|
18
|
+
const protectedBranches = ['main', 'master', 'development'];
|
|
19
|
+
const additionalProtectedBranches = [...process.argv.slice(2)];
|
|
20
|
+
|
|
21
|
+
// Check if the current branch starts with any of the additional
|
|
22
|
+
// protected branch name
|
|
23
|
+
let matchesAdditionalBranch = false;
|
|
24
|
+
for (let i = 0; i < additionalProtectedBranches.length; i++) {
|
|
25
|
+
matchesAdditionalBranch = matchesAdditionalBranch || theBranch.startsWith(additionalProtectedBranches[i]);
|
|
26
|
+
}
|
|
27
|
+
return protectedBranches.includes(theBranch) || matchesAdditionalBranch;
|
|
20
28
|
};
|
|
21
29
|
const npmRunner = async script => {
|
|
22
30
|
try {
|
package/lib/web/unleash.js
CHANGED
|
@@ -14,9 +14,17 @@ const getCurrentBranchName = async () => {
|
|
|
14
14
|
return Object.entries(branchInfo.branches).find(([name, info]) => info.current)[0];
|
|
15
15
|
};
|
|
16
16
|
const isProtected = async () => {
|
|
17
|
-
const protectedBranches = ['main', 'master', 'development', ...process.argv.slice(2)];
|
|
18
17
|
const theBranch = await getCurrentBranchName();
|
|
19
|
-
|
|
18
|
+
const protectedBranches = ['main', 'master', 'development'];
|
|
19
|
+
const additionalProtectedBranches = [...process.argv.slice(2)];
|
|
20
|
+
|
|
21
|
+
// Check if the current branch starts with any of the additional
|
|
22
|
+
// protected branch name
|
|
23
|
+
let matchesAdditionalBranch = false;
|
|
24
|
+
for (let i = 0; i < additionalProtectedBranches.length; i++) {
|
|
25
|
+
matchesAdditionalBranch = matchesAdditionalBranch || theBranch.startsWith(additionalProtectedBranches[i]);
|
|
26
|
+
}
|
|
27
|
+
return protectedBranches.includes(theBranch) || matchesAdditionalBranch;
|
|
20
28
|
};
|
|
21
29
|
const npmRunner = async script => {
|
|
22
30
|
try {
|
package/package.json
CHANGED
package/src/unleash.js
CHANGED
|
@@ -17,9 +17,20 @@ const getCurrentBranchName = async () => {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const isProtected = async () => {
|
|
20
|
-
const protectedBranches = [ 'main', 'master', 'development', ...process.argv.slice( 2 ) ]
|
|
21
20
|
const theBranch = await getCurrentBranchName()
|
|
22
|
-
|
|
21
|
+
|
|
22
|
+
const protectedBranches = [ 'main', 'master', 'development' ]
|
|
23
|
+
const additionalProtectedBranches = [ ...process.argv.slice( 2 ) ]
|
|
24
|
+
|
|
25
|
+
// Check if the current branch starts with any of the additional
|
|
26
|
+
// protected branch name
|
|
27
|
+
let matchesAdditionalBranch = false
|
|
28
|
+
for ( let i = 0; i < additionalProtectedBranches.length; i++ ) {
|
|
29
|
+
matchesAdditionalBranch = matchesAdditionalBranch ||
|
|
30
|
+
theBranch.startsWith( additionalProtectedBranches[i] )
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return protectedBranches.includes( theBranch ) || matchesAdditionalBranch
|
|
23
34
|
}
|
|
24
35
|
|
|
25
36
|
const npmRunner = async ( script ) => {
|