Skip to content

Commit 907dce9

Browse files
committed
update to utils/archive.sh script to include man pages
1 parent 9c17b22 commit 907dce9

File tree

9 files changed

+37
-18
lines changed

9 files changed

+37
-18
lines changed

.github/workflows/latest_game_archive.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
2323
- name: "Creating the archive"
2424
run: |
25-
git fetch --tags --force && ./utils/archive.sh
25+
git fetch --tags --force && ./utils/gameshell_archive.sh
2626
2727
- uses: "marvinpinto/action-automatic-releases@latest"
2828
with:

.github/workflows/tag_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
2121
- name: "Creating the archive"
2222
run: |
23-
git fetch --tags --force && ./utils/archive.sh
23+
git fetch --tags --force && ./utils/gameshell_archive.sh
2424
2525
- uses: "marvinpinto/action-automatic-releases@latest"
2626
with:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ADD --chown=gsh-user:gsh-user https://github.com/phyver/GameShell/releases/downl
4545
### if you prefer to use a local customized version, comment the preceeding
4646
### ADD ...
4747
### line and uncomment the next one
48-
### (NOTE that you need to have generated a "gameshell.sh" file with GSH_ROOT/utils/archive.sh
48+
### (NOTE that you need to have generated a "gameshell.sh" file with GSH_ROOT/utils/gameshell_archive.sh
4949
# COPY gameshell.sh .
5050

5151
ENTRYPOINT ["bash", "./gameshell.sh"]

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,22 @@ new: i18n/template.pot
3636

3737
## check that the auto.sh scripts work as expected
3838
check: clean
39-
./utils/archive.sh -at -N "game shell (1)"
39+
./utils/gameshell_archive.sh -at -N "game shell (1)"
4040
./"game shell (1).sh" -q -c 'gsh systemconfig; for _ in $$(seq 50); do gsh auto --abort < <(echo gsh); done; gsh stat'
4141

4242
## check that the auto.sh scripts work as expected, in verbose mode
4343
check-verbose: clean
44-
./utils/archive.sh -at -N "game shell (1)"
44+
./utils/gameshell_archive.sh -at -N "game shell (1)"
4545
./"game shell (1).sh" -Dq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh auto --abort; done; gsh stat'
4646

4747
## run all the test.sh and auto.sh scripts
4848
tests-bash: clean
49-
./utils/archive.sh -at -N "game shell (1)"
49+
./utils/gameshell_archive.sh -at -N "game shell (1)"
5050
./"game shell (1).sh" -Bdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat'
5151

5252
## run all the test.sh and auto.sh scripts
5353
tests-zsh: clean
54-
./utils/archive.sh -at -N "game shell (1)"
54+
./utils/gameshell_archive.sh -at -N "game shell (1)"
5555
./"game shell (1).sh" -Zdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat'
5656

5757
clean:

doc/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Q. Can I use GameShell in the classroom?
5454
A. Of course! GameShell was initially developed for this very reason.
5555

5656
Note that you can create your own GameShell archives with the missions you
57-
want using the `GSH_ROOT/utils/archive.sh` script. You should probably
57+
want using the `GSH_ROOT/utils/gameshell_archive.sh` script. You should probably
5858

5959
- choose a password different from the default `gsh` (option `-p ...`)
6060
- activate the "passport" mode by default (option `-P`). The only

doc/gameshell.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,17 @@ while creating missions (`gsh assert ...`, `gsh test`).
115115

116116

117117

118-
Creating an executable archive
118+
Creating an executable [archive](archive)
119119
------------------------------
120120

121-
The script `utils/archive.sh` is used to create an executable archive to
121+
The script `utils/gameshell_archive.sh` is used to create an executable archive to
122122
distribute a (customized) version of GameShell.
123123

124124
By default, it creates an archive with all the missions listed in the
125125
`$GSH_ROOT/missions/index.txt` file and with all the available translations.
126126
You can choose the missions you want by listing them on the command line:
127127
```sh
128-
$ ./utils/archive.sh missions/basic/01_cd_tower missions/basic/02_cd.._cellar/ missions/basic/03_cd_HOME_throne/
128+
$ ./utils/gameshell_archive.sh missions/basic/01_cd_tower missions/basic/02_cd.._cellar/ missions/basic/03_cd_HOME_throne/
129129
```
130130
If a directory contains an `index.txt` file, all the missions listed in it
131131
will be included. You can also give an `index.txt` file directly on the
@@ -147,5 +147,5 @@ You can customize the archive with the following options
147147

148148
More options are available and listed in the output of
149149
```sh
150-
$ ./utils/archive.sh -h
150+
$ ./utils/gameshell_archive.sh -h
151151
```

doc/misc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ $ ./GameShell/start.sh
3636
### 3/ from an executable archive
3737

3838
This is the easiest way to distribute GameShell to a group of students. Once you've
39-
cloned the repository, create an executable archive with the `archive.sh` script:
39+
cloned the repository, create an executable archive with the `gameshell_archive.sh` script:
4040
```sh
4141
$ cd GameShell
42-
$ ./utils/archive.sh
42+
$ ./utils/gameshell_archive.sh
4343
copy missions
4444
-> copy basic/03_cd_HOME_throne
4545
-> copy basic/04_mkdir_chest

scripts/progress_bar

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ animation() {
208208

209209
# NOTE: disabling echoing in terminal during animation doesn't always work in zsh!
210210
# running
211-
# ./utils/archive.sh -a missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires; ./gameshell.sh -Dqc "gsh auto"
211+
# ./utils/makeshell_archive.sh -a missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires; ./gameshell.sh -Dqc "gsh auto"
212212
# loops!
213213
# Removing the stty -echo / stty echo makes the problem go away.
214214
# I'm not sure what happens...

utils/archive.sh renamed to utils/gameshell_archive.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ mkdir "$TMP_DIR/$NAME"
163163
# copy source files
164164
# NOTE: macOS' cp doesn't have '--archive', and '-a' is not POSIX.
165165
# use POSIX options to make sure it is portable
166-
cp -RPp "$GSH_ROOT/start.sh" "$GSH_ROOT/scripts" "$GSH_ROOT/utils" "$GSH_ROOT/lib" "$GSH_ROOT/i18n" "$TMP_DIR/$NAME"
166+
cp -RPp "$GSH_ROOT/start.sh" "$GSH_ROOT/scripts" "$GSH_ROOT/utils" "$GSH_ROOT/lib" "$GSH_ROOT/i18n" "$GSH_ROOT/man" "$TMP_DIR/$NAME"
167167

168168

169169
# generate default index file
170170
ALL_INDEX_FILES=default.idx
171171
mkdir "$TMP_DIR/$NAME/missions"
172172
if ! make_index "$@" > "$TMP_DIR/$NAME/missions/default.idx"
173173
then
174-
echo "Error: archive.sh, couldn't make default.idx"
174+
echo "Error: gameshell_archive.sh, couldn't make default.idx"
175175
# --system makes GameShell use the standard rm utility instead of the "safe"
176176
# rm implemented in scripts/rm
177177
rm --system -rf "$TMP_DIR"
@@ -186,7 +186,7 @@ do
186186
ALL_INDEX_FILES="$ALL_INDEX_FILES:$(basename "$FILE")"
187187
if ! make_index "$FILE" > "$TMP_DIR/$NAME/missions/$(basename "$FILE")"
188188
then
189-
echo "Error: archive.sh, couldn't make $(basename "$FILE")"
189+
echo "Error: gameshell_archive.sh, couldn't make $(basename "$FILE")"
190190
# --system makes GameShell use the standard rm utility instead of the "safe"
191191
# rm implemented in scripts/rm
192192
rm --system -rf "$TMP_DIR"
@@ -297,6 +297,22 @@ then
297297
fi
298298
done
299299
done
300+
301+
# remove translated manual pages
302+
find "$GSH_ROOT/man" -type d | while read -r dir
303+
do
304+
if [ "$(basename "$dir")" = "man1" ] || [ "$(basename "$dir")" = "man" ]
305+
then
306+
continue
307+
fi
308+
if ! keep_language "$dir" "$LANGUAGES"
309+
then
310+
# --system makes GameShell use the standard rm utility instead of the "safe"
311+
# rm implemented in scripts/rm
312+
printf "."
313+
rm --system -rf "$dir"
314+
fi
315+
done
300316
echo
301317
fi
302318

@@ -366,6 +382,9 @@ echo "removing unnecessary files"
366382
[ "$KEEP_TEST" -ne 1 ] && find ./missions -name "test.sh" | xargs rm --system -f
367383
[ "$KEEP_AUTO" -ne 1 ] && find ./missions -name auto.sh | xargs rm --system -f
368384
rm --system -rf "$GSH_ROOT/utils/"
385+
rm --system -f "$GSH_ROOT/i18n/gamesh-commands"
386+
rm --system -f "$GSH_ROOT/man/en"
387+
rm --system -f "$GSH_ROOT/man/README" "$GSH_ROOT/i18n/gameshell-*help/README"
369388
)
370389

371390
# change admin password

0 commit comments

Comments
 (0)