Skip to content

Commit

Permalink
set notes instead of append
Browse files Browse the repository at this point in the history
* reload will add notes multiple times if we append
  • Loading branch information
naveenrajm7 committed Jul 25, 2024
1 parent 496ad3b commit 7f0d1a1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/vagrant_utm/scripts/customize_vm.applescript
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on run argv
set vmName to ""
set cpuCount to 0
set memorySize to 0
set additionalNotes to ""
set vmNotes to ""

-- Parse arguments
repeat with i from 2 to (count argv)
Expand All @@ -16,7 +16,7 @@ on run argv
else if currentArg is "--memory" then
set memorySize to item (i + 1) of argv
else if currentArg is "--notes" then
set additionalNotes to item (i + 1) of argv
set vmNotes to item (i + 1) of argv
end if
end repeat

Expand All @@ -39,10 +39,9 @@ on run argv
set memory of config to memorySize
end if

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

-- Save the configuration
Expand Down

0 comments on commit 7f0d1a1

Please sign in to comment.