Skip to content

Instantly share code, notes, and snippets.

@krisk0
Created August 3, 2026 04:55
Show Gist options
  • Select an option

  • Save krisk0/afb2676709eb586cbcc22c73a1105295 to your computer and use it in GitHub Desktop.

Select an option

Save krisk0/afb2676709eb586cbcc22c73a1105295 to your computer and use it in GitHub Desktop.
Unpack CK3 mod, keep only .txt .yml .gui, get rid of some localizations
#!/bin/bash
set -ex
[[ $2 == "" ]] && exit 1
[[ -s "$1" ]] || exit 1
7z x "$1" -o$2 -r '*.txt' '*.yml' '*.gui'
cd $2
for x in `find -type d -name mod_files` ; do
(
cd `dirname $x`
mv mod_files/* .
rmdir mod_files
)
done
l=`find -name localization -type d 2>/dev/null || true`
[[ -d "$l" ]] && (
cd $l
GLOBIGNORE="english:russian:languages.yml"
rm -rf *
unset GLOBIGNORE
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment