safe-rm 3.0.1 → 3.1.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/.safe-rm/config +1 -1
- package/Makefile +0 -3
- package/README.md +2 -2
- package/bin/rm.sh +12 -5
- package/install.sh +1 -1
- package/package.json +1 -1
- package/uninstall.sh +1 -1
package/.safe-rm/config
CHANGED
package/Makefile
CHANGED
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
[Safe-rm][safe-rm], a drop-in and much safer replacement of the unix [`rm`][rm] command with **ALMOST FULL** features of the original [`rm`][rm].
|
|
16
16
|
|
|
17
|
-
The project was initially developed
|
|
17
|
+
The project was initially developed on Mac OS X and has been continuously used by myself since then, with later testing conducted on Linux. If you encounter any issues during use, please feel free to [submit an issue](https://github.com/kaelzhang/shell-safe-rm/issues/new).
|
|
18
18
|
|
|
19
19
|
## Features
|
|
20
20
|
- Supports both MacOS and Linux with full test coverage.
|
|
@@ -149,7 +149,7 @@ export SAFE_RM_USE_APPLESCRIPT=no
|
|
|
149
149
|
|
|
150
150
|
By default, on MacOS, `safe-rm` uses AppleScript as much as possible so that removed files could be put back from system Trash app.
|
|
151
151
|
|
|
152
|
-
### Change the Default
|
|
152
|
+
### Change the Default Trash Bin Other Than System Default
|
|
153
153
|
|
|
154
154
|
```sh
|
|
155
155
|
export SAFE_RM_TRASH=/path/to/trash
|
package/bin/rm.sh
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
|
-
#!/bin/bash
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
# Basic configuration
|
|
4
4
|
# ------------------------------------------------------------------------------
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# You could modify the root config directory of safe-rm by using
|
|
7
|
+
# ```sh
|
|
8
|
+
# $ export SAFE_RM_CONFIG_ROOT=/path/to/safe-rm-config
|
|
9
|
+
# ```
|
|
10
|
+
if [[ -n $XDG_CONFIG_HOME && -d "$XDG_CONFIG_HOME/safe-rm" ]]; then
|
|
11
|
+
# If XDG_CONFIG_HOME is set, use it as the configuration root
|
|
12
|
+
SAFE_RM_CONFIG_ROOT=${SAFE_RM_CONFIG_ROOT:="$XDG_CONFIG_HOME/safe-rm"}
|
|
13
|
+
else
|
|
14
|
+
SAFE_RM_CONFIG_ROOT=${SAFE_RM_CONFIG_ROOT:="$HOME/.safe-rm"}
|
|
15
|
+
fi
|
|
7
16
|
|
|
8
17
|
# You could modify the location of the configuration file by using
|
|
9
18
|
# ```sh
|
|
10
19
|
# $ export SAFE_RM_CONFIG=/path/to/safe-rm.conf
|
|
11
20
|
# ```
|
|
12
|
-
SAFE_RM_CONFIG=${SAFE_RM_CONFIG:="$
|
|
21
|
+
SAFE_RM_CONFIG=${SAFE_RM_CONFIG:="$SAFE_RM_CONFIG_ROOT/config"}
|
|
13
22
|
|
|
14
23
|
if [[ -f "$SAFE_RM_CONFIG" ]]; then
|
|
15
24
|
source "$SAFE_RM_CONFIG"
|
|
16
25
|
fi
|
|
17
26
|
|
|
18
|
-
SAFE_RM_CONFIG_ROOT=${SAFE_RM_CONFIG_ROOT:="$HOME/.safe-rm"}
|
|
19
|
-
|
|
20
27
|
# Print debug info or not
|
|
21
28
|
SAFE_RM_DEBUG=${SAFE_RM_DEBUG:=}
|
|
22
29
|
|
package/install.sh
CHANGED
package/package.json
CHANGED
package/uninstall.sh
CHANGED