jsir 1.0.6 → 1.0.7
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/cmd/ooa.js +6 -6
- package/package.json +1 -1
package/cmd/ooa.js
CHANGED
|
@@ -72,7 +72,7 @@ const _mainCmdMap = {
|
|
|
72
72
|
comment: "工作脚本模式",
|
|
73
73
|
cmd: ['@f ']
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
rm: {
|
|
76
76
|
comment: "删除脚本",
|
|
77
77
|
cmd: ['@-']
|
|
78
78
|
},
|
|
@@ -80,7 +80,7 @@ const _mainCmdMap = {
|
|
|
80
80
|
comment: "编辑脚本",
|
|
81
81
|
cmd: ['@w']
|
|
82
82
|
},
|
|
83
|
-
|
|
83
|
+
diff: {
|
|
84
84
|
comment: "比较脚本变更",
|
|
85
85
|
cmd: ['@c']
|
|
86
86
|
},
|
|
@@ -132,7 +132,7 @@ run(async () => {
|
|
|
132
132
|
_cmdMap = objDataFile('ooaCmdMap.json')
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
if (['run', 'edit', '
|
|
135
|
+
if (['run', 'edit', 'rm', 'diff', 'push', 'pull'].indexOf(_args[0]) !== -1
|
|
136
136
|
&& _args[1] && !/^\d+$/.test(_args[1])) {
|
|
137
137
|
let name = `e ${_args[1]}.js`
|
|
138
138
|
let path = _home + '/' + name
|
|
@@ -144,7 +144,7 @@ run(async () => {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
if (['run', 'edit', '
|
|
147
|
+
if (['run', 'edit', 'rm', 'diff', 'push', 'pull'].indexOf(_args[0]) !== -1
|
|
148
148
|
&& _args[1] && !/^\d+$/.test(_args[1])) {
|
|
149
149
|
warn('wrong args')
|
|
150
150
|
return
|
|
@@ -170,7 +170,7 @@ run(async () => {
|
|
|
170
170
|
}
|
|
171
171
|
return i
|
|
172
172
|
}).join(' ').replace(/^@/, '')
|
|
173
|
-
if (['run', 'edit', '
|
|
173
|
+
if (['run', 'edit', 'rm', 'diff', 'push', 'pull'].indexOf(_args[0]) !== -1 && !trim(argStr)) {
|
|
174
174
|
_args[0] = '@'
|
|
175
175
|
}
|
|
176
176
|
if (['ls'].indexOf(_args[0]) !== -1 && !trim(argStr)) {
|
|
@@ -655,7 +655,7 @@ async function dealKeyword(str, strs, fstr, ostr) {
|
|
|
655
655
|
_fs.unlinkSync(cmdsDir + '/' + name)
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
|
-
info(`${path}
|
|
658
|
+
info(`${path} removed`)
|
|
659
659
|
}
|
|
660
660
|
} else if (/^\+\d*$/.test(fstr)) {
|
|
661
661
|
let name = _cmdMap[trim(fstr.replace(/^\+/, ''))]
|