From 53a5e56cda23b7681a71cfa1b2aaae5585f284d7 Mon Sep 17 00:00:00 2001 From: Amaury Date: Sat, 26 Jun 2021 16:42:04 +0200 Subject: [PATCH] Add a script to deploy the plugin with a tmp folder --- .rsyncignore | 5 +++++ package.json | 5 +++-- scripts/deploy.sh | 12 ++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .rsyncignore create mode 100644 scripts/deploy.sh diff --git a/.rsyncignore b/.rsyncignore new file mode 100644 index 0000000..663bd78 --- /dev/null +++ b/.rsyncignore @@ -0,0 +1,5 @@ +.* +node_modules/ +src/ +package-lock.json +tsconfig.json \ No newline at end of file diff --git a/package.json b/package.json index 29fd241..0ad018b 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,12 @@ "README.md" ], "scripts": { - "prepublish": "tsc" + "buildAndDeploy": "npm run build && npm run deploy", + "deploy": "bash ./scripts/deploy.sh", + "build": "tsc" }, "staticDirs": {}, "translations": { - "fr-FR": "./languages/fr.json" }, "dependencies": { "listener-rss-agregator": "0.0.2" diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100644 index 0000000..00b2a88 --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,12 @@ +tmp_dir=$(mktemp -d)/peertube-plugin-auto-import-ytb/ +work_dir=$(pwd)/ +# echo $work_dir + +mkdir $tmp_dir +# echo "directory created" +rsync --exclude-from=$work_dir.rsyncignore $work_dir $tmp_dir -ar +# echo "rsync --exclude-from=$work_dir.rsyncignore $work_dir $tmp_dir" +# echo "rsync done" +cd ../PeerTube +node ./dist/server/tools/peertube.js plugins install --path $tmp_dir +# echo $tmp_dir \ No newline at end of file