Skip to content

Commit 7991f7a

Browse files
committed
feat(lib): allow shortcuts to use variables
1 parent 45eb5eb commit 7991f7a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/shortcuts.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
function create_startmenu_shortcuts($manifest, $dir, $global, $arch) {
33
$shortcuts = @(arch_specific 'shortcuts' $manifest $arch)
44
$shortcuts | Where-Object { $_ -ne $null } | ForEach-Object {
5-
$target = [System.IO.Path]::Combine($dir, $_.item(0))
5+
$target = $ExecutionContext.InvokeCommand.ExpandString($_.item(0))
6+
if($target -eq $_.item(0)){
7+
$target = [System.IO.Path]::Combine($dir, $_.item(0))
8+
}
69
$target = New-Object System.IO.FileInfo($target)
710
$name = $_.item(1)
811
$arguments = ''
@@ -11,7 +14,10 @@ function create_startmenu_shortcuts($manifest, $dir, $global, $arch) {
1114
$arguments = $_.item(2)
1215
}
1316
if ($_.length -ge 4) {
14-
$icon = [System.IO.Path]::Combine($dir, $_.item(3))
17+
$icon = $ExecutionContext.InvokeCommand.ExpandString($_.item(3))
18+
if($icon -eq $_.item(3)){
19+
$icon = [System.IO.Path]::Combine($dir, $_.item(3))
20+
}
1521
$icon = New-Object System.IO.FileInfo($icon)
1622
}
1723
$arguments = (substitute $arguments @{ '$dir' = $dir; '$original_dir' = $original_dir; '$persist_dir' = $persist_dir })

0 commit comments

Comments
 (0)