fix: run post-install script

This commit is contained in:
Jan De Dobbeleer 2020-11-01 11:44:26 +01:00
parent 46fbf3d51c
commit 16e9fd2c6e
3 changed files with 8 additions and 8 deletions

View file

@ -133,8 +133,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/packages/scoop/oh-my-posh.json
asset_name: oh-my-posh.json
asset_path: ${{ github.workspace }}/packages/scoop/scoop.json
asset_name: scoop.json
asset_content_type: text/plain
- name: Upload Scoop Post Install
id: upload-scoop-post-install

View file

@ -1,20 +1,20 @@
Param
(
[parameter(Mandatory=$true)]
[parameter(Mandatory = $true)]
[string]
$Version,
[parameter(Mandatory=$true)]
[parameter(Mandatory = $true)]
[string]
$LinuxSHA,
[parameter(Mandatory=$true)]
[parameter(Mandatory = $true)]
[string]
$WindowsSHA
)
$content = Get-Content '.\oh-my-posh.json' -Raw
$content = Get-Content '.\scoop.json' -Raw
$content = $content.Replace('<VERSION>', $Version)
$content = $content.Replace('<HASH_LINUX>', $LinuxSHA)
$content = $content.Replace('<HASH_WINDOWS>', $WindowsSHA)
$fileHash = Get-FileHash post-install.ps1 -Algorithm SHA256
$content = $content.Replace('<HASH_INSTALL_SCRIPT>', $fileHash.Hash)
$content | Out-File -Encoding 'UTF8' '.\oh-my-posh.json'
$content | Out-File -Encoding 'UTF8' '.\scoop.json'

View file

@ -17,5 +17,5 @@
"<HASH_INSTALL_SCRIPT>"
],
"bin": ["posh-linux-amd64", "posh-windows-amd64.exe"],
"post_install": "./post-install.ps1"
"post_install": "& \"$dir/post-install.ps1\""
}