~imperator/quartiermeister-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH 1/2] bin: create: add item.Flush() error check

Details
Message ID
<20210305215411.14207-1-stanner@posteo.de>
DKIM signature
pass
Download raw message
Patch: +4 -1
---
 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 == "" {
		goto out
	}
-- 
2.20.1

[PATCH 2/2] qm: add ground path creation

Details
Message ID
<20210305215411.14207-2-stanner@posteo.de>
In-Reply-To
<20210305215411.14207-1-stanner@posteo.de> (view parent)
DKIM signature
pass
Download raw message
Patch: +2 -0
---
 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
Details
Message ID
<8636d563-7f50-5917-c568-a2521c94e61c@rumpelsepp.org>
In-Reply-To
<20210305215411.14207-1-stanner@posteo.de> (view parent)
DKIM signature
pass
Download raw message
On 05.03.21 22:54, Philipp Stanner wrote:
> +	if err = it.Flush(); err != nil {
> +		fmt.Fprintln(os.Stderr, err)
> +		os.Exit(-1)
> +	}

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
Reply to thread Export thread (mbox)