Skip to content

Commit 4819f86

Browse files
committed
simplified array code and now testing path with spaces
1 parent 7dbcae6 commit 4819f86

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

archive_vms.zsh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ i=0
2121

2222
while true; do
2323
# Test whether running .vmx files are inside our path.
24-
running=$(vmrun list | grep "$SRCPATH")
24+
running=(${(@f)"$(vmrun list | grep "$SRCPATH")"})
2525

2626
echo "Current running VM list is $running"
2727

@@ -36,13 +36,10 @@ while true; do
3636

3737
echo "Attempting to suspend VMs"
3838

39-
xIFS=$IFS
40-
IFS=$'\n'
4139
for vmx in $running; do
4240
echo "Suspending $vmx"
4341
vmrun suspend "$vmx"
4442
done
45-
IFS=$xIFS
4643
done
4744

4845
# Create a compressed read-only .dmg. HFS+ seems to be smaller than APFS.

tests/archive_vms.zunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
}
4747

4848
@test 'Running VMs inside path are passed to suspend command' {
49-
vmone="$TEMP/decoy_dir/examplevmone.vmx"
49+
vmone="$TEMP/decoy_dir/examplevm one.vmx"
5050
vmtwo="$TEMP/decoy_dir/examplevmtwo.vmx"
5151
bogusvm="$TEMP/some_other_dir/examplevm.vmx"
5252

0 commit comments

Comments
 (0)