Here is a generic bash shell script for single file installs that you can easily modify and include in your own projects.
The script confirms that the target directory path exists and copies the developer-specified file into that path. If it does not exist, it creates the directory path and then copies the file into the new directory.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Save the script as
TARGET_DIRwith the target install directory
INSTALL_FILEwith the path to the file that is to be installed
SUCCESS_MSGwith the message to present to the user after a successful install
The user will need navigate to the directory that contains
install.sh in your release and set the file permissions so that they can execute the script:
and then use it with the following command:
The script is available on GitHub.