@modernpoacher/deps 1.5.1 → 1.5.4
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/bin/common/index.js +2 -2
- package/lib/common/git/index.js +1 -1
- package/lib/common/index.js +1 -1
- package/package.json +1 -1
- package/src/common/git/index.js +4 -4
- package/src/common/index.js +1 -1
package/bin/common/index.js
CHANGED
|
@@ -64,7 +64,7 @@ exit 0
|
|
|
64
64
|
const getNpmiCommands = (directory = DIRECTORY, registry = REGISTRY, force = false) => normalise(`
|
|
65
65
|
cd "${directory}"
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
${platform === 'win32' ? `echo "${NVM}"` : `. "${NVM}"`}
|
|
68
68
|
|
|
69
69
|
${getRegistryParameter(registry, getForceParameter(force, 'npm i'))}
|
|
70
70
|
|
|
@@ -74,7 +74,7 @@ exit 0
|
|
|
74
74
|
const getDepsCommands = (directory = DIRECTORY, registry = REGISTRY, force = false) => normalise(`
|
|
75
75
|
cd "${directory}"
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
${platform === 'win32' ? `echo "${NVM}"` : `. "${NVM}"`}
|
|
78
78
|
|
|
79
79
|
${getRegistryParameter(registry, getForceParameter(force, 'deps'))}
|
|
80
80
|
|
package/lib/common/git/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.catGitRefsRemotesOriginHead=catGitRefsRemotesOriginHead;exports.gitAdd=gitAdd;exports.gitCheckout=gitCheckout;exports.gitCommit=gitCommit;exports.gitPull=gitPull;exports.gitPush=gitPush;exports.gitPushTags=gitPushTags;exports.gitRevParse=gitRevParse;var _debug=_interopRequireDefault(require("debug"));var _os=require("os");var _child_process=require("child_process");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}const DIRECTORY='.';const BRANCH='master';const ADD='package.json package-lock.json';const COMMIT=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.catGitRefsRemotesOriginHead=catGitRefsRemotesOriginHead;exports.gitAdd=gitAdd;exports.gitCheckout=gitCheckout;exports.gitCommit=gitCommit;exports.gitPull=gitPull;exports.gitPush=gitPush;exports.gitPushTags=gitPushTags;exports.gitRevParse=gitRevParse;var _debug=_interopRequireDefault(require("debug"));var _os=require("os");var _child_process=require("child_process");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}const DIRECTORY='.';const BRANCH='master';const ADD='package.json package-lock.json';const COMMIT=_os.platform==='win32'?'Updated `package.json` &/ `package-lock.json`':'Updated \\`package.json\\` &/ \\`package-lock.json\\`';const OPTIONS={maxBuffer:1024*2000};const log=(0,_debug.default)('@modernpoacher/deps');log(`\`git\` (${_os.platform}) is awake`);const trim=v=>v.split('\n').map(v=>v.trimEnd()).join('\n').trim();function use(key){const log=(0,_debug.default)(`@modernpoacher/deps:${key}`);return function use(v){if(v.trim()==='')return;return log(trim(v));};}function out(key,directory){const log=(0,_debug.default)(`@modernpoacher/deps:${key}`);return function out(v){const s=v.trim();if(s===''||directory===s)return;return log(trim(s));};}function err(key,directory){const log=(0,_debug.default)(`@modernpoacher/deps:${key}`);return function err(v){const s=v.trim();if(s===''||directory===s||s.toLowerCase().startsWith('fatal: not a git repository'))return;return log(trim(s));};}const getErrorCode=({code=0}={})=>code;const getErrorMessage=({message=''}={})=>message;function getCatGitRefsRemotesOriginHeadCommand(directory=DIRECTORY){log('getCatGitRefsRemotesOriginHeadCommand');return`
|
|
2
2
|
DIR=$(echo "${directory}/.git/refs/remotes/origin/HEAD" | sed -e "s/\\//\\\\\\/g" -e "s/://" | cat 2> /dev/null)
|
|
3
3
|
[[ $DIR =~ "[-0-9a-zA-Z]*$" ]]
|
|
4
4
|
echo "$\{BASH_REMATCH[0]}"
|
package/lib/common/index.js
CHANGED
package/package.json
CHANGED
package/src/common/git/index.js
CHANGED
|
@@ -14,7 +14,7 @@ const BRANCH = 'master'
|
|
|
14
14
|
|
|
15
15
|
const ADD = 'package.json package-lock.json'
|
|
16
16
|
|
|
17
|
-
const COMMIT = platform
|
|
17
|
+
const COMMIT = platform === 'win32'
|
|
18
18
|
? 'Updated `package.json` &/ `package-lock.json`'
|
|
19
19
|
: 'Updated \\`package.json\\` &/ \\`package-lock.json\\`' /* eslint-disable-line no-useless-escape */
|
|
20
20
|
|
|
@@ -35,7 +35,7 @@ function use (key) {
|
|
|
35
35
|
if (v.trim() === '') return
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
|
-
log(trim(v))
|
|
38
|
+
log(trim(v))
|
|
39
39
|
)
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -46,7 +46,7 @@ function out (key, directory) {
|
|
|
46
46
|
return function out (v) {
|
|
47
47
|
const s = v.trim()
|
|
48
48
|
|
|
49
|
-
if (directory === s) return
|
|
49
|
+
if (s === '' || directory === s) return
|
|
50
50
|
|
|
51
51
|
return (
|
|
52
52
|
log(trim(s))
|
|
@@ -60,7 +60,7 @@ function err (key, directory) {
|
|
|
60
60
|
return function err (v) {
|
|
61
61
|
const s = v.trim()
|
|
62
62
|
|
|
63
|
-
if (directory === s || s.toLowerCase().startsWith('fatal: not a git repository')) return
|
|
63
|
+
if (s === '' || directory === s || s.toLowerCase().startsWith('fatal: not a git repository')) return
|
|
64
64
|
|
|
65
65
|
return (
|
|
66
66
|
log(trim(s))
|