ruikurenaii_performium/bashBuild.sh

46 lines
No EOL
1.2 KiB
Bash
Executable file

#!/bin/bash
npm run build
if [ ! -d 'performium' ]; then
mkdir 'performium'
echo 'Directory created: performium'
fi
mv build/main.js performium/main.js
cp styles.css performium/styles.css
cp manifest.json performium/manifest.json
echo 'Moved files to directory: performium'
rmdir 'build'
echo 'Directory removed: build'
function yes_or_no {
while true; do
read -p "$* [y/n]: " yn
case $yn in
[Yy]* ) return 0;;
[Nn]* ) echo "Aborted" ; return 1;;
esac
done
}
# for dev purposes, feel free to change the location
PLUGIN_FOLDER="/home/sebastian/Documents/Obsidian/Arch Linux/.obsidian/plugins/performosu"
if yes_or_no "Do you want to move the plugin and it's contents?"; then
echo 'Moving the directory: performium'
read -p 'Which directory? Directory: ' directory
mv performium/* "$directory"
echo "Moved directory to: $directory"
rmdir 'performium'
echo "Removed directory: performium"
else
if yes_or_no "Do you want to remove the compiled plugin files?"; then
rm -rf 'performium'
echo "Removed directory: performium"
else
echo "Aborted the action."
fi
fi