chore: add linux: script, command
This commit is contained in:
parent
0b967ff33e
commit
3a1075db49
12
linux/README
Normal file
12
linux/README
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# dir-odt-to-pdf
|
||||||
|
|
||||||
|
Convert source directory with .odt files to target path with .pdf* files
|
||||||
|
|
||||||
|
> Source files will be converted if are changed or not exist in target path
|
||||||
|
|
||||||
|
copy (drag-and-rpo) DirOdtToPdf.app to /Applications
|
||||||
|
|
||||||
|
Run 'install.command' to install commands and scripts so it can be used
|
||||||
|
from applicationa and in terminal via command line
|
||||||
|
|
||||||
|
Script 'run-dir-odt-to-pdf.sh' can be adjusted to source and target paths
|
46
linux/install.command
Executable file
46
linux/install.command
Executable file
@ -0,0 +1,46 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
BOLD="\033[1m"
|
||||||
|
GREEN="\033[32m"
|
||||||
|
RED="\033[31m"
|
||||||
|
MAGENTA="\033[35m"
|
||||||
|
INVERT="\033[7m"
|
||||||
|
NORMAL="\033[0m"
|
||||||
|
|
||||||
|
MACOS_APP_PATH="DirOdtToPdf.app"
|
||||||
|
APP_PACKAGE="DirOdtToPdf"
|
||||||
|
APP_NAME="dir-odt-to-pdf"
|
||||||
|
RUN_APP_PATH="run-${APP_NAME}.sh"
|
||||||
|
BIN_APP_PATH=${BIN_APP_PATH:-/usr/local/bin}
|
||||||
|
|
||||||
|
echo -e "\nInstall ${BOLD}${GREEN}${INVERT} ${MACOS_APP_PATH} ${NORMAL}"
|
||||||
|
if ! test -d /Applications/${MACOS_APP_PATH} && test -d /Volumes/${APP_PACKAGE}; then
|
||||||
|
cp -pr /Volumes/${APP_PACKAGE}/${MACOS_APP_PATH} /Applications/${MACOS_APP_PATH}
|
||||||
|
fi
|
||||||
|
if ! test -d /Applications/${MACOS_APP_PATH} ; then
|
||||||
|
echo -e "Error $RED /Applications/${MACOS_APP_PATH} not found ${NORMAL}"
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
cd /Applications/${MACOS_APP_PATH} || exit 1;
|
||||||
|
if test -r Contents/MacOS/${APP_NAME} ; then
|
||||||
|
cp Contents/MacOS/${APP_NAME} ${BIN_APP_PATH}/${APP_NAME}
|
||||||
|
echo -e "\n${BOLD}${GREEN}${INVERT}Contents/MacOS/${APP_NAME}${NORMAL} to ${MAGENTA}${BIN_APP_PATH}/${APP_NAME}${NORMAL}"
|
||||||
|
fi
|
||||||
|
if test -r Contents/MacOS/${RUN_APP_PATH} && test -r ${BIN_APP_PATH}/${RUN_APP_PATH} ; then
|
||||||
|
echo -en "Are you sure you want to delete current script (${BOLD}${GREEN}${BIN_APP_PATH}/${RUN_APP_PATH}${NORMAL})? (s/n): "
|
||||||
|
read -r answer
|
||||||
|
case $answer in
|
||||||
|
yes|y|s|si)
|
||||||
|
rm -rf ${BIN_APP_PATH}/${RUN_APP_PATH}
|
||||||
|
echo -e "\nDeleted ${BOLD}${GREEN}${INVERT} ${RUN_APP_PAT} ${{NORMAL}";
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo -e "\n${BOLD}${GREEN}${INVERT} No deleted ${NORMAL}";
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
if test -r Contents/MacOS/${RUN_APP_PATH} && ! test -r ${BIN_APP_PATH}/${RUN_APP_PATH} ; then
|
||||||
|
cp Contents/MacOS/${RUN_APP_PATH} ${BIN_APP_PATH}/${RUN_APP_PATH}
|
||||||
|
chmod +x ${BIN_APP_PATH}/${RUN_APP_PATH}
|
||||||
|
echo -e "\n${BOLD}${GREEN}${INVERT}}}Contents/MacOS/${RUN_RUN_APP_PATH}${NORMAL} to ${MAGENTA}${BIN_APP_PATH}/${RUN_APP_PATH}${NORMAL}"
|
||||||
|
fi
|
||||||
|
echo -e "\n${BOLD}${GREEN}${INVERT} ${MACOS_APP_PATH} ${NORMAL} Installed"
|
Loading…
x
Reference in New Issue
Block a user