From 9386677ad7c486fd6504b1e78202dbce3072b70d Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sun, 10 Jun 2018 23:58:10 +0200 Subject: [PATCH] Update to last commits from 486 --- actions.json | 18 ++++++++---------- scripts/actions/public_private | 10 ---------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/actions.json b/actions.json index 8171dd4..1a9d9b1 100644 --- a/actions.json +++ b/actions.json @@ -1,22 +1,20 @@ -{ - "public_private": { +[{ + "id": "public_private", "name": "Move to public or private", - "command": "/bin/bash $YNH_APP_ID/scripts/actions/public_private", + "command": "/bin/bash scripts/actions/public_private", "user": "root", - "cwd": "/etc/yunohost/apps/", - "accepted_return_codes": [0, 1, 2, 3], + "accepted_return_codes": [0], "description": { "en": "Change the public access of the app." }, "arguments": [ { "name": "is_public", - "type": "string", + "type": "boolean", "ask": { - "en": "Is it a public app ? (yes/no)" + "en": "Is it a public app ? (1/0) (1=yes; 0=no)" }, - "example": "yes, no" + "default": true } ] - } -} +}] diff --git a/scripts/actions/public_private b/scripts/actions/public_private index 372e47c..ab3d3f4 100755 --- a/scripts/actions/public_private +++ b/scripts/actions/public_private @@ -21,16 +21,6 @@ app=$YNH_APP_ID # CHECK IF ARGUMENTS ARE CORRECT #================================================= -if [ "$is_public" = "y" ] || [ "$is_public" = "yes" ]; then - is_public=1 -elif [ "$is_public" = "n" ] || [ "$is_public" = "no" ]; then - is_public=0 -fi - -if [ "$is_public" != "0" ] && [ "$is_public" != "1" ]; then - ynh_die "Argument is_public is incorrect, should be 'yes' or 'no'" -fi - #================================================= # CHECK IF AN ACTION HAS TO BE DONE #=================================================