-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/gen: Create alias function for Windows PowerShell
Closes #20
- Loading branch information
Showing
8 changed files
with
51 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
# Hugo Version Manager: override path to the hugo executable. | ||
|
||
TBD | ||
function Hugo-Override { | ||
Set-Variable -Name "hvm_show_status" -Value $true | ||
Set-Variable -Name "hugo_bin" -Value $(hvm status --printExecPath) | ||
If ($hugo_bin) { | ||
If ($hvm_show_status) { | ||
echo "Hugo version management is enabled in this directory." | ||
echo "Run 'hvm status' for details, or 'hvm disable' to disable.`n" | ||
} | ||
& "$hugo_bin" $args | ||
} Else { | ||
Set-Variable -Name "hugo_bin" -Value $((gcm hugo.exe).Path 2> $null) | ||
If ($hugo_bin) { | ||
& "$hugo_bin" $args | ||
} Else { | ||
echo "Command not found" | ||
} | ||
} | ||
} | ||
Set-Alias hugo Hugo-Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters