Skip to content

Instantly share code, notes, and snippets.

@user5145
Last active October 17, 2018 19:10
Show Gist options
  • Save user5145/ce972f3f81a285ff6a591b886828828d to your computer and use it in GitHub Desktop.
Save user5145/ce972f3f81a285ff6a591b886828828d to your computer and use it in GitHub Desktop.
create osz files from old osu's songs folder using bash
#!/bin/bash
set -e
#path to songs folder
songs=$(readlink -f "songs")
saveto=$(readlink -f "songs-osz")
echo "your files will be in $saveto"
#create a dir
mkdir -p "$saveto"
#for each song
cd "$songs" && for f in *; do
echo "the next file is $f"
# for each file in song's folder
echo "entering $f"
cd "$f" && for f2 in *; do
zip -0r "$saveto/$f.osz" "./$f2"
done
echo "leaving $f"
cd ..
done
echo "finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment