added `install.sh` + `uninstall.sh`

This commit is contained in:
xdrm-brackets 2016-12-07 12:22:49 +01:00
parent 3b55a56b24
commit 93653d8680
6 changed files with 30 additions and 1 deletions

0
exporter/Builder.php Normal file → Executable file
View File

0
exporter/Exporter.php Normal file → Executable file
View File

2
exporter/main.php Normal file → Executable file
View File

@ -1,6 +1,6 @@
<?php define('__ROOT__', dirname(dirname(__FILE__)) ); <?php define('__ROOT__', dirname(dirname(__FILE__)) );
require_once 'Exporter.php'; require_once __ROOT__.'/exporter/Exporter.php';
/* [1] Initialisation /* [1] Initialisation
=========================================================*/ =========================================================*/

0
exporter/packages.json Normal file → Executable file
View File

16
install.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
chmod -R +x `pwd`/exporter || ( echo "permission error" && exit );
dst="/usr/local/bin/xfw";
echo "Making the command \`xfw\` globally accessible";
echo "Create a symlink to $dst ? (y,n)";
read createlink;
echo "\n";
if [ "$createlink" = "y" ]; then
echo "(1) creating symlink";
echo "#!/bin/sh\n\nphp `pwd`/exporter/main.php \$*;" > $dst && echo "(2) changing permissions" && chmod +x $dst && echo "\n* The command \`xfw\` can now be used from everywhere" || ( echo "* aborting - removing file" && rm $dst );
else
echo "* aborting";
fi;

13
uninstall.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
dst="/usr/local/bin/xfw";
echo "Remove the symlink to $dst ? (y,n)";
read removelink;
echo "\n";
if [ "$removelink" = "y" ]; then
rm $dst && echo "* The command \`xfw\` is no more accessible." || echo "* aborting";
else
echo "* aborting";
fi;