Skip to content

Commit 1599538

Browse files
authored
fix(TPL-1857): update cask to not rely on local_config.rb (#28)
1 parent 6dce98a commit 1599538

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: |
2727
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
2828
.\bin\checkver.ps1 * -u
29-
echo "VENV_VERSION='${{ steps.latest.outputs.tag_name }}'" | Out-File -FilePath .\Casks\local_config.rb
29+
.\bin\update-cask-version.ps1 -NewVersion "${{ steps.latest.outputs.tag_name }}" -FilePath .\Casks\dev-cloud.rb
3030
3131
- name: Create pull request
3232
uses: peter-evans/create-pull-request@v5

Casks/dev-cloud.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
require_relative 'local_config.rb'
2-
31
cask "dev-cloud" do
42

5-
version VENV_VERSION
3+
version "2.22.1"
64
sha256 :no_check
75

86
url "https://github.com/DocPlanner/dev-cloud-releases/releases/download/#{version}/dev-#{version}-osx-x64.zip"

Casks/local_config.rb

Lines changed: 0 additions & 1 deletion
This file was deleted.

bin/update-cask-version.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
param(
2+
[Parameter(Mandatory=$true)]
3+
[string]$NewVersion,
4+
[Parameter(Mandatory=$true)]
5+
[string]$FilePath
6+
)
7+
8+
$content = Get-Content -Path $FilePath -Raw
9+
$newContent = $content -replace 'version "([0-9]+\.[0-9]+\.[0-9]+)"', "version `"$NewVersion`""
10+
$newContent | Set-Content -Path $FilePath

0 commit comments

Comments
 (0)