a/codesys-ide/codesys | b/codesys-ide/codesys | ||
---|---|---|---|
... |
... |
||
44 | if [ -f ${libdir}/${libbase}.pdf ]; then |
44 | if [ -f ${libdir}/${libbase}.pdf ]; then |
45 | mkdir -p .drone-artifacts/${libdir} |
45 | mkdir -p .drone-artifacts/${libdir} |
46 | cp ${libdir}/${libbase}.pdf .drone-artifacts/${libdir}/${libbase}.pdf |
46 | cp ${libdir}/${libbase}.pdf .drone-artifacts/${libdir}/${libbase}.pdf |
47 | fi |
47 | fi |
48 | done |
48 | done |
49 | else |
49 | elif [ "${1}" == "install" ]; then |
50 | 50 | # check if file exists, before we call PackageManager with it |
|
51 | url=${2} |
||
52 | filename=${url} |
||
53 | tmpfile=$(mktemp --suffix=.package) |
||
54 | if [ "${url%:*}" == "https" ]; then |
||
55 | filename=${tmpfile} |
||
56 | wget --output-document=${filename} "${url}" |
||
57 | elif [ ! -f ${filename} ]; then |
||
58 | echo "error: package '${filename}' not found." |
||
59 | exit -1 |
||
60 | fi |
||
61 | export DISPLAY=:91 |
||
62 | Xvfb :91 &> /dev/zero & |
||
63 | sleep 1 |
||
64 | export WINEPREFIX=~/.wine.cds |
||
65 | ${WINE} ~/.wine.cds/drive_c/CODESYS/CODESYS/Common/PackageManagerCLI.exe --culture=en --profile="'"${profile}"'" --components="typical" --verbose --install="${filename}" |
||
66 | |||
67 | result=$? |
||
68 | |||
69 | rm ${tmpfile} |
||
70 | |||
71 | sleep 1 |
||
72 | killall Xvfb |
||
73 | rm -rf /tmp/.X91* |
||
74 | |||
75 | if [ "${result}" == "0" ]; then |
||
76 | true |
||
77 | else |
||
78 | false |
||
79 | fi |
||
80 | else |
||
51 | # check if file exists, before we call CODESYS with it |
81 | # check if file exists, before we call CODESYS with it |
52 | if [ ! -f ${BASEPATH}/${1}.py ]; then |
82 | if [ ! -f ${BASEPATH}/${1}.py ]; then |
53 | echo "error: script '${BASEPATH}/${1}.py' not found." |
83 | echo "error: script '${BASEPATH}/${1}.py' not found." |
54 | exit -1 |
84 | exit -1 |
55 | fi |
85 | fi |