[PATCH 1/2] bin: create: add item.Flush() error check
Export this patch
---
bin/qm-create/main.go | 5 ++++ -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/bin/qm-create/main.go b/bin/qm-create/main.go
index d29fdce..c5a45ab 100644
--- a/bin/qm-create/main.go
@@ -23,7 +23,10 @@ func createItem(c *qm.Collection, opts *options) {
os.Exit(-1)
}
- it.Flush()
+ if err = it.Flush(); err != nil {
+ fmt.Fprintln(os.Stderr, err)
+ os.Exit(-1)
+ }
if opts.parent == "" {
Why do you use a negative exit code? This doesn't seem to make sense.
$ bash -c "exit -1"
$ echo $?
255
Exit codes of programs are positive integers to my knowledge.
S
goto out
}
--
2.20.1
[PATCH 2/2] qm: add ground path creation
Export this patch
---
qm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/qm b/qm
index 8f8ef47..a3b2d6f 100755
--- a/qm
+++ b/qm
@@ -18,6 +18,8 @@ main() {
if [[ ! -d "$QM_PATH" ]]; then
echo "\"$QM_PATH\" created."
mkdir -p "$QM_PATH"
+ mkdir -p "$QM_PATH"/$QM_COLLECTION/pool
+ mkdir -p "$QM_PATH"/$QM_COLLECTION/projects
fi
if which "qm-$cmd" >& /dev/null; then
--
2.20.1