Skip to content

Commit 7f0d1a1

Browse files
committed
set notes instead of append
* reload will add notes multiple times if we append
1 parent 496ad3b commit 7f0d1a1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/vagrant_utm/scripts/customize_vm.applescript

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on run argv
44
set vmName to ""
55
set cpuCount to 0
66
set memorySize to 0
7-
set additionalNotes to ""
7+
set vmNotes to ""
88

99
-- Parse arguments
1010
repeat with i from 2 to (count argv)
@@ -16,7 +16,7 @@ on run argv
1616
else if currentArg is "--memory" then
1717
set memorySize to item (i + 1) of argv
1818
else if currentArg is "--notes" then
19-
set additionalNotes to item (i + 1) of argv
19+
set vmNotes to item (i + 1) of argv
2020
end if
2121
end repeat
2222

@@ -39,10 +39,9 @@ on run argv
3939
set memory of config to memorySize
4040
end if
4141

42-
-- Append to the notes if --notes is provided
43-
if additionalNotes is not "" then
44-
set currentNotes to notes of config
45-
set notes of config to currentNotes & "\n" & additionalNotes
42+
-- Set the notes if --notes is provided (existing notes will be overwritten)
43+
if vmNotes is not "" then
44+
set notes of config to vmNotes
4645
end if
4746

4847
-- Save the configuration

0 commit comments

Comments
 (0)