pianoverse_client/build/createPatchedBundle.nu

25 lines
683 B
Text
Raw Normal View History

2024-11-25 15:25:15 +00:00
def downloadScript [] {
rm -f bundle.js
print $"(ansi yellow)Downloading the script.."
wget -q https://pianoverse.net/bundle.js
}
def applyPatches [] {
print $"(ansi yellow)Applying patches!.."
let patches = (ls build | find .patch | each { |i| $i.name })
$patches
| each {|i|
let splitted = open $i | split row -r '\n';
let needle = $splitted | get 0;
let haystack = $splitted | skip 1 | str join "";
open bundle.js | str replace $needle $haystack| save -f bundle.js
print $"(ansi green)Applied patch ($i)!"
}
}
downloadScript
applyPatches
print $"(ansi green)Happy hacking!"