forked from rethink-neil/makeself
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
script & args -> startup command, fix megastep#171
* edit `makeself-header`: * change every `script` & `scriptargs` to `startup_command` * use `quote` (implemented in `makeself.sh`) to assign `startup_command` * change diagnostic references of "script" to "command" * edit `makeself.sh`: * add Rich Felker's `quote` and `save` * move first instructions to follow last function definition * use `save` to assign `MS_COMMAND` * use `save` to assign `STARTUP_COMMAND` * add `test/startupcommandtest` to test weird characters in files and startup commands
- Loading branch information
1 parent
1160982
commit fd241d0
Showing
4 changed files
with
100 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
|
||
THIS="$(readlink -f "$0")" | ||
HERE="$(dirname "${THIS}")" | ||
SUT="$(dirname "${HERE}")/makeself.sh" | ||
|
||
testStartupCommand() { | ||
( | ||
export TMPDIR="$(mktemp -d "${PWD}/tmpdir.XXXXXX")" | ||
|
||
local weirdname_list="$(mktemp -t weirdname_list.XXXXXX)" | ||
cat >"${weirdname_list}" <<'EOF' | ||
_!_exclamation_mark | ||
_"_quotation_mark | ||
_#_octothorp | ||
_$_dollar | ||
_%_percent | ||
_&_ampersand | ||
_'_apostrophe | ||
_(_left_parenthesis | ||
_)_right_parenthesis | ||
_*_asterisk | ||
_+_plus | ||
_,_comma | ||
_-_hyphen | ||
_._full_stop | ||
_:_colon | ||
_;_semicolon | ||
_<_less_than | ||
_=_equals | ||
_>_greater_than | ||
_?_interrogative | ||
_@_ampersat | ||
_[_left_square_bracket | ||
_\_reverse_solidus | ||
_]_right_square_bracket | ||
_^_caret | ||
_{_left_bracket | ||
_|_vertical_bar | ||
_}_right_bracket | ||
EOF | ||
|
||
set -eu | ||
while read weirdname; do | ||
local archive_dir="$(mktemp -dt archive_dir.XXXXXX)" | ||
echo "${weirdname}" | tee "${archive_dir}/${weirdname}.txt" | ||
local file_name="$(mktemp -ut "file_name.XXXXXX")" | ||
"${SUT}" \ | ||
--nocomp --nox11 \ | ||
"${archive_dir}" "${file_name}" "The Label" "ls -lah ${weirdname}.txt" | ||
assertEqual $? 0 | ||
"${file_name}" --list | ||
assertEqual $? 0 | ||
"${file_name}" --info | ||
assertEqual $? 0 | ||
"${file_name}" --dumpconf | ||
assertEqual $? 0 | ||
"${file_name}" | ||
assertEqual $? 0 | ||
done <"${weirdname_list}" | ||
rm -rf "${TMPDIR}" | ||
) | ||
} | ||
|
||
source "${HERE}/bashunit/bashunit.bash" |