Skip to content

Commit

Permalink
Symlink pages.en to pages (tldr-pages#11139)
Browse files Browse the repository at this point in the history
* Symlink `pages.en` to `pages`

* Update `build.sh` to symlink `pages.en` to `pages`
  • Loading branch information
acuteenvy authored Oct 21, 2023
1 parent 44e52ce commit af2f6d9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions pages.en
24 changes: 15 additions & 9 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,25 @@ function build_translation_archives {
rm -f "$target_directory/*"

for lang_dir in "$source_directory"/pages*; do
if [ -d "$lang_dir" ]; then
local lang=$(basename "$lang_dir")
local archive_name="tldr-$lang.zip"
# Skip symlinks (pages.en) and things that are not directories
if [ ! -d "$lang_dir" ] || [ -h "$lang_dir" ]; then
continue
fi

# Create the zip archive
local lang=$(basename "$lang_dir")
local archive_name="tldr-$lang.zip"

cd "$lang_dir"
zip -q -r "$target_directory/$archive_name" .
zip -q -j "$target_directory/$archive_name" "$source_directory/LICENSE.md"
# Create the zip archive

echo "Pages archive of $archive_name successfully created."
fi
cd "$lang_dir"
zip -q -r "$target_directory/$archive_name" .
zip -q -j "$target_directory/$archive_name" "$source_directory/LICENSE.md"

echo "Pages archive of $archive_name successfully created."
done

cd "$target_directory"
ln -s tldr-pages.zip tldr-pages.en.zip
}

###################################
Expand Down

0 comments on commit af2f6d9

Please sign in to comment.