26 lines
619 B
Bash
26 lines
619 B
Bash
|
#!/usr/bin/env nix-shell
|
||
|
#!nix-shell -i bash -p php.packages.composer git
|
||
|
|
||
|
SOURCE=$1
|
||
|
WRITE_PATH=$(realpath $2)
|
||
|
SOURCE_EXTRACTED=$(mktemp -du)
|
||
|
|
||
|
cp -r $SOURCE $SOURCE_EXTRACTED
|
||
|
chmod -R +w $SOURCE_EXTRACTED
|
||
|
|
||
|
cd $SOURCE_EXTRACTED
|
||
|
|
||
|
rm composer.lock
|
||
|
|
||
|
composer update
|
||
|
|
||
|
rm -rf vendor
|
||
|
|
||
|
$(nix-build -E 'let composer2nix = builtins.fetchGit {url = "https://git.chir.rs/darkkirb/composer2nix.git"; }; in import composer2nix')/bin/composer2nix
|
||
|
|
||
|
cp composer-env.nix php-packages.nix $WRITE_PATH
|
||
|
|
||
|
rm result
|
||
|
|
||
|
git diff --no-index $SOURCE $SOURCE_EXTRACTED | sed "s,$SOURCE,,g" | sed "s,$SOURCE_EXTRACTED,,g" > $WRITE_PATH/update.patch
|