-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add packaging for standalone files (#1710)
In preparation for automatically deploying them to release pages.
- Loading branch information
1 parent
47379ed
commit f0c9395
Showing
7 changed files
with
91 additions
and
1 deletion.
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
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,28 @@ | ||
#!/bin/sh | ||
|
||
# Written mostly by GPT-4 https://web.archive.org/web/20231111233735/https://chat.openai.com/share/8098af96-4a10-4083-bf47-7f9e8cc333ed | ||
|
||
# Check if $RANDOM is available | ||
if [ -z "$RANDOM" ]; then | ||
random="$$" | ||
else | ||
random="$RANDOM" | ||
fi | ||
|
||
# Try to use mktemp if available | ||
if command -v mktemp > /dev/null; then | ||
# MacOS and some BSDs require a template for mktemp | ||
if [ "$(uname)" = "Darwin" ] || [ "$(uname)" = "FreeBSD" ]; then | ||
temp_dir="$(mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXX")" | ||
else | ||
temp_dir="$(mktemp -d 2>/dev/null || mktemp -d -t 'tmp')" | ||
fi | ||
else | ||
# Fallback: Create a directory with a random name in TMPDIR or /tmp | ||
dir="${TMPDIR:-/tmp}/tmp.$random" | ||
mkdir -p "$dir" | ||
temp_dir="$dir" | ||
fi | ||
|
||
# Output the path of the created directory | ||
printf "%s\n" "$temp_dir" |