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 }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ needs.release.outputs.upload_url }} upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/packages/scoop/oh-my-posh.json asset_path: ${{ github.workspace }}/packages/scoop/scoop.json
asset_name: oh-my-posh.json asset_name: scoop.json
asset_content_type: text/plain asset_content_type: text/plain
- name: Upload Scoop Post Install - name: Upload Scoop Post Install
id: upload-scoop-post-install id: upload-scoop-post-install

View file

@ -11,10 +11,10 @@ Param
$WindowsSHA $WindowsSHA
) )
$content = Get-Content '.\oh-my-posh.json' -Raw $content = Get-Content '.\scoop.json' -Raw
$content = $content.Replace('<VERSION>', $Version) $content = $content.Replace('<VERSION>', $Version)
$content = $content.Replace('<HASH_LINUX>', $LinuxSHA) $content = $content.Replace('<HASH_LINUX>', $LinuxSHA)
$content = $content.Replace('<HASH_WINDOWS>', $WindowsSHA) $content = $content.Replace('<HASH_WINDOWS>', $WindowsSHA)
$fileHash = Get-FileHash post-install.ps1 -Algorithm SHA256 $fileHash = Get-FileHash post-install.ps1 -Algorithm SHA256
$content = $content.Replace('<HASH_INSTALL_SCRIPT>', $fileHash.Hash) $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>" "<HASH_INSTALL_SCRIPT>"
], ],
"bin": ["posh-linux-amd64", "posh-windows-amd64.exe"], "bin": ["posh-linux-amd64", "posh-windows-amd64.exe"],
"post_install": "./post-install.ps1" "post_install": "& \"$dir/post-install.ps1\""
} }