diff options
author | Cem Keylan <cem@ckyln.com> | 2020-05-13 03:19:29 +0300 |
---|---|---|
committer | Cem Keylan <cem@ckyln.com> | 2020-05-13 03:19:29 +0300 |
commit | baa1cfb1e2f9a3d9443c481028f9499bcfbe6e93 (patch) | |
tree | ebb96219f8d23e74b6d136e5c301d55197e2c2be | |
parent | a66138085195d4c9f2b7a9b33c34f983e7afcc5f (diff) | |
download | mkrootfs-baa1cfb1e2f9a3d9443c481028f9499bcfbe6e93.tar.gz |
change directory in a subshell
-rwxr-xr-x | mkrootfs.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mkrootfs.sh b/mkrootfs.sh index db59291..a65d2aa 100755 --- a/mkrootfs.sh +++ b/mkrootfs.sh @@ -91,7 +91,8 @@ msg "Removing root cache" rm -rf "$MNTDIR/root/.cache" msg "Generating rootfs to $BASEDIR" -cd "$MNTDIR" || die "Could not change directory to $MNTDIR" -tar -cpvJf "$BASEDIR/carbs-rootfs-$(date +%Y%m%d).tar.xz" . -cd "$BASEDIR" || die "Could not change directory to $BASEDIR" +( + cd "$MNTDIR" || die "Could not change directory to $MNTDIR" + tar -cpvJf "$BASEDIR/carbs-rootfs-$(date +%Y%m%d)-$(uname -m).tar.xz" . +) msg "Done!" |