@jswork/ushell-module-base 1.0.59 → 1.0.61

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.
Files changed (2) hide show
  1. package/modules/_ins.sh +24 -1
  2. package/package.json +1 -1
package/modules/_ins.sh CHANGED
@@ -1,5 +1,28 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  function ins() {
4
- cp "$1" /usr/local/bin/
4
+ if [ $# -eq 1 ]; then
5
+ # 只有一个参数,保持现有逻辑
6
+ cp "$1" /usr/local/bin/
7
+ elif [ $# -eq 2 ]; then
8
+ # 如果有两个参数,将 $1 复制到 /usr/local/bin/$2
9
+ cp "$1" "/usr/local/bin/$2"
10
+ else
11
+ # 参数错误提示
12
+ echo "Usage: ins <source> [destination]"
13
+ return 1
14
+ fi
15
+ }
16
+
17
+ function binfix() {
18
+ # $1 为目录的 bin 文件
19
+ # 如果没有 $1 参数,则提示使用方法
20
+ if [ $# -eq 0 ]; then
21
+ echo "Usage: binfix <binfile>"
22
+ return 1
23
+ fi
24
+
25
+ # sudo xattr -d com.apple.quarantine $1
26
+ cd /usr/local/bin
27
+ sudo xattr -d com.apple.quarantine "$1"
5
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/ushell-module-base",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
4
4
  "description": "Unix like shell base module.",
5
5
  "main": "index.sh",
6
6
  "repository": {