Styx: Improve macOS application copying
This commit is contained in:
parent
811fec2756
commit
9e2f0a4676
1 changed files with 20 additions and 7 deletions
|
@ -62,6 +62,7 @@ in
|
||||||
tokei
|
tokei
|
||||||
viddy
|
viddy
|
||||||
wget
|
wget
|
||||||
|
xxHash
|
||||||
xz
|
xz
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -81,15 +82,27 @@ in
|
||||||
in
|
in
|
||||||
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
baseDir="$HOME/Applications/Home Manager Apps"
|
baseDir="$HOME/Applications/Home Manager Apps"
|
||||||
if [ -d "$baseDir" ]; then
|
$DRY_RUN_CMD mkdir -p "$baseDir"
|
||||||
rm -f "''${baseDir}/.DS_Store"
|
|
||||||
rm -rf "$baseDir"
|
|
||||||
fi
|
|
||||||
mkdir -p "$baseDir"
|
|
||||||
for appFile in ${apps}/Applications/*; do
|
for appFile in ${apps}/Applications/*; do
|
||||||
|
appFileChecksum="$(find "$appFile/Contents/MacOS" -type f -exec md5 -q {} \; | md5 -q)"
|
||||||
target="$baseDir/$(basename "$appFile")"
|
target="$baseDir/$(basename "$appFile")"
|
||||||
|
|
||||||
|
if [ -d "$target" ]; then
|
||||||
|
targetChecksum="$(find "$target/Contents/MacOS" -type f -exec md5 -q {} \; | md5 -q)"
|
||||||
|
else
|
||||||
|
targetChecksum="0"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$appFileChecksum" = "$targetChecksum" ]; then
|
||||||
|
echo "Application not changed: $(basename "$appFile")"
|
||||||
|
else
|
||||||
|
echo -n "Coyping application $(basename "$appFile"): "
|
||||||
|
$DRY_RUN_CMD rm -rf "$target"
|
||||||
$DRY_RUN_CMD cp ''${VERBOSE_ARG:+-v} -fHRL "$appFile" "$baseDir"
|
$DRY_RUN_CMD cp ''${VERBOSE_ARG:+-v} -fHRL "$appFile" "$baseDir"
|
||||||
$DRY_RUN_CMD chmod ''${VERBOSE_ARG:+-v} -R +w "$target"
|
$DRY_RUN_CMD chmod ''${VERBOSE_ARG:+-v} -R +w "$target"
|
||||||
|
echo 'Done'
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue