Translate copy-repo
script to fish
This commit is contained in:
parent
6c1b259560
commit
f23fa342ae
4 changed files with 14 additions and 16 deletions
|
@ -10,7 +10,7 @@ profileDir="/mnt/archiso-valhalla";
|
||||||
projectDir="$rootHome/PortValhalla";
|
projectDir="$rootHome/PortValhalla";
|
||||||
nixDir="$profileDir/$root/nix/var/nix/profiles/per-user/root/channels/nixpkgs";
|
nixDir="$profileDir/$root/nix/var/nix/profiles/per-user/root/channels/nixpkgs";
|
||||||
mkdir -p "$rootHome";
|
mkdir -p "$rootHome";
|
||||||
"${BASH_SOURCE%/*}/../../scripts/copy-repo.sh" "$projectDir";
|
fish "${BASH_SOURCE%/*}/../../scripts/copy-repo.fish" "$projectDir";
|
||||||
|
|
||||||
if [ ! -d "$nixCache" ]; then
|
if [ ! -d "$nixCache" ]; then
|
||||||
mkdir -p "$nixCache"
|
mkdir -p "$nixCache"
|
||||||
|
|
|
@ -39,7 +39,7 @@ pacstrap -K "$ARCH_MOUNT_ROOT" \
|
||||||
texinfo \
|
texinfo \
|
||||||
;
|
;
|
||||||
|
|
||||||
../../copy-repo.sh "${ARCH_MOUNT_ROOT}$tempRoot";
|
fish ../../copy-repo.fish "${ARCH_MOUNT_ROOT}$tempRoot";
|
||||||
genfstab -U "$ARCH_MOUNT_ROOT" >> "$ARCH_MOUNT_ROOT/etc/fstab";
|
genfstab -U "$ARCH_MOUNT_ROOT" >> "$ARCH_MOUNT_ROOT/etc/fstab";
|
||||||
|
|
||||||
arch-chroot "$ARCH_MOUNT_ROOT" systemctl enable NetworkManager;
|
arch-chroot "$ARCH_MOUNT_ROOT" systemctl enable NetworkManager;
|
||||||
|
|
12
scripts/copy-repo.fish
Executable file
12
scripts/copy-repo.fish
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/env fish
|
||||||
|
begin
|
||||||
|
set -l target "$argv[1]"
|
||||||
|
set -l dir "$(status dirname)/.."
|
||||||
|
git clone "$dir" "$target"
|
||||||
|
git -C "$dir" diff HEAD | git -C "$target" apply --allow-empty
|
||||||
|
|
||||||
|
git -C "$dir" ls-files --exclude-standard --others | \
|
||||||
|
while read file
|
||||||
|
cp "$dir/$file" "$target/$file"
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,14 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
function copyRepo() {
|
|
||||||
local dir="${BASH_SOURCE%/*}/..";
|
|
||||||
local target="$1";
|
|
||||||
git clone "$dir" "$target";
|
|
||||||
git -C "$dir" diff HEAD | git -C "$target" apply --allow-empty;
|
|
||||||
|
|
||||||
git -C "$dir" ls-files --exclude-standard --others | \
|
|
||||||
while read file; do
|
|
||||||
cp "$dir/$file" "$target/$file";
|
|
||||||
done;
|
|
||||||
}
|
|
||||||
|
|
||||||
copyRepo "$@";
|
|
Loading…
Reference in a new issue