We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f3e6531 commit 3f40aacCopy full SHA for 3f40aac
file.bash
@@ -70,17 +70,29 @@ cmd_edit() {
70
print_usage
71
fi
72
73
+ if [[ ${path: -4} != ".b64" ]]; then
74
+ path="${path}.b64"
75
+ fi
76
+
77
+ local passfile="$PREFIX/$path.gpg"
78
79
if [[ -z $EDITOR ]]; then
80
echo "\$EDITOR not set, don't know how to open file."
81
exit 1
82
else
83
local tmpfile=$(mktemp)
84
+ local newfile=0
85
chmod 0600 $tmpfile
-
- cmd_retrieve $path > $tmpfile
- if [[ $? -ne 0 ]]; then
- rm $tmpfile
- exit 1
86
87
+ if [[ -f $passfile ]]; then
88
+ cmd_retrieve $path > $tmpfile
89
+ if [[ $? -ne 0 ]]; then
90
+ rm $tmpfile
91
+ exit 1
92
93
+ else
94
+ echo "File does not exist, creating new file..."
95
+ sleep 3
96
97
98
$EDITOR $tmpfile
0 commit comments