diff --git a/matrixpack.sh b/matrixpack.sh index b3d2285e1bc7a9d39163f47a74e4e1396a299c5e..0c751c3b4fcd74ccab9d134cf4b39b5f57991973 100755 --- a/matrixpack.sh +++ b/matrixpack.sh @@ -1,16 +1,17 @@ #!/bin/bash # usage -# matrixpack token homeserver +# matrixpack token homeserver directory # # pack name is the folder name # sticker name is the file name # /!\ token is sensitive information -if test $# != 2 ; then - echo 1>&2 "$0:FATAL: $# invalid argument number (expected 2)" +if test $# != 3 ; then + echo 1>&2 "$0:FATAL: $# invalid argument number (expected 3)" exit 1 fi +cd $3 dir=$(pwd) token=$1 packname=${dir##*/} @@ -34,3 +35,4 @@ mkdir "$packname" mv "preview.png" "$packname" echo -e "### $packname \n" > "$packname/README.md" echo -n "$json]}" > "$packname/$packname.json" +cd -