Created
April 12, 2017 21:36
-
-
Save khorevaa/b76fb70f71a44fd413aa1d24fa7fec0b to your computer and use it in GitHub Desktop.
Создание исполняемого oscript файла
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
create_oscript_app() | |
{ | |
([ -z ${1} ]) \ | |
&& abort "error app path" | |
([ -z ${2} ]) \ | |
&& abort "error bin path" | |
app_path=${1} | |
bin_path=${2} | |
([ -n "${3}" ]) \ | |
&& app_name=${3} \ | |
|| app_name=${app_path%.*} | |
file_name=${bin_path}/${app_name} | |
cat > ${file_name} << EOF | |
#!/bin/bash | |
oscript "${app_path}" "\$@" | |
EOF | |
chmod +x ${file_name} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment