Skip to content

Commit 985429c

Browse files
Merge pull request #83 from DudeBro249/dev
feat: version 1.2.1
2 parents 79c1086 + b0d6b02 commit 985429c

File tree

8 files changed

+44
-16
lines changed

8 files changed

+44
-16
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
build:
9-
name: Build wheels on ${{ matrix.os }}
9+
name: Build binary on ${{ matrix.os }}
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.2.1 (2021-08-02)
2+
3+
- Version 1.2.1
4+
- Fix powershell installer to get latest release tag dynamically
5+
- Minor changes
6+
17
## 1.2.0 (2021-08-01)
28

39
- Version 1.2.0
@@ -7,9 +13,9 @@
713
## 1.1.1 (2021-06-04)
814

915
- Version 1.1.1.
10-
- Add <code>[dotenv](https://docrunner-cli.web.app/docs/configuration#dotenv)</code>
16+
- Add [`dotenv`](https://docrunner-cli.web.app/docs/configuration#dotenv)
1117
as a configuration option in the `docrunner.toml` configuration file
12-
- Added <code>[docrunner self update](https://docrunner-cli.web.app/docs/getting-started#updating)<code> command
18+
- Added [`docrunner self update`](https://docrunner-cli.web.app/docs/getting-started#updating) command
1319

1420
## 1.1.0 (2021-06-03)
1521

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ curl https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/in
2121

2222
Powershell (Windows):
2323
```powershell
24-
iwr -useb https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install.ps1 | iex
24+
iwr -useb https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install-windows.ps1 | iex
2525
```
2626

2727
If none of these methods work, you can also install the `docrunner` binary from

installers/install.ps1 renamed to installers/install-windows.ps1

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,37 @@ $ErrorActionPreference = "Stop"
77
# Defining path to docrunner executable in variable
88
$DocrunnerDirectory = 'C:\src\Docrunner'
99

10+
# Function to get the redirected url
11+
Function Get-RedirectedUrl {
12+
Param (
13+
[Parameter(Mandatory=$true)]
14+
[String]$URL
15+
)
16+
17+
$request = [System.Net.WebRequest]::Create($url)
18+
$request.AllowAutoRedirect=$false
19+
$response=$request.GetResponse()
20+
21+
If ($response.StatusCode -eq "Found")
22+
{
23+
$response.GetResponseHeader("Location")
24+
}
25+
}
26+
1027
# Only create Docrunner directory if it does not already exist
1128
if (Test-Path -Path $DocrunnerDirectory) {
12-
Write-Host "$DocrunnerDirectory already exists"
13-
Write-Host "Not creating directory"
29+
Write-Host "$DocrunnerDirectory already exists, no need to create directory"
1430
Write-Host ""
1531
} else {
1632
new-item $DocrunnerDirectory -itemtype directory
1733
}
1834

1935
# Download docrunner.exe from github releases
20-
Start-BitsTransfer 'https://github.com/DudeBro249/docrunner/releases/download/v1.1.1/docrunner.exe' "$DocrunnerDirectory\docrunner.exe" -Description 'Downloading Docrunner from https://github.com/DudeBro249/docrunner/releases' -DisplayName 'Downloading Docrunner' -TransferType Download
36+
$LATEST_RELEASE_URL = Get-RedirectedUrl -URL 'https://github.com/DudeBro249/docrunner/releases/latest'
37+
$LATEST_RELEASE_TAG = $LATEST_RELEASE_URL.Split("/")[7]
38+
$DOCRUNNER_BINARY_URL = "https://github.com/DudeBro249/docrunner/releases/download/$LATEST_RELEASE_TAG/docrunner-windows.exe"
39+
40+
Start-BitsTransfer $DOCRUNNER_BINARY_URL "$DocrunnerDirectory\docrunner.exe" -Description "Downloading Docrunner from $DOCRUNNER_BINARY_URL" -DisplayName 'Downloading Docrunner' -TransferType Download
2141

2242
Write-Host 'Installing Docrunner' -ForegroundColor cyan
2343

@@ -31,8 +51,7 @@ if ($UserPath -ne $null)
3151
if ($UserPath -split ';' -contains $DocrunnerDirectory)
3252
{
3353
Write-Host ""
34-
Write-Host "$DocrunnerDirectory already exists in PATH"
35-
Write-Host "No need to add it"
54+
Write-Host "$DocrunnerDirectory already exists in PATH, no need to add it"
3655
Write-Host ""
3756
}
3857
else

lib/commands/self/update.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,20 @@ class UpdateCommand extends Command {
1818
var outputMessage = 'Copy and paste this command into your terminal: ';
1919
if (Platform.isWindows) {
2020
installationCommand =
21-
'iwr -useb https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install.ps1 | iex';
21+
'iwr -useb https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install-windows.ps1 | iex';
2222
outputMessage =
2323
'Copy and paste this command into your powershell terminal';
24-
} else if (Platform.isMacOS || Platform.isLinux) {
24+
} else if (Platform.isLinux) {
2525
installationCommand =
26-
'curl -fsSL https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install.sh | sh';
26+
'curl https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install-linux.sh | sudo bash';
27+
} else if (Platform.isMacOS) {
28+
installationCommand =
29+
'curl https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install-mac.sh | sudo bash';
2730
}
2831

2932
stdout.writeln(
3033
Colorize(
31-
'$outputMessage\n',
34+
'\n$outputMessage\n',
3235
).green(),
3336
);
3437
stdout.writeln('$installationCommand\n');

lib/constants/version.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
const version = '1.1.1';
1+
const version = '1.2.1';

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: docrunner
22
description: A command line tool which allows you to run the code in your markdown files to ensure that readers always have access to working code.
3-
version: 1.2.0
3+
version: 1.2.1
44
homepage: https://github.com/DudeBro249/docrunner
55

66
environment:

website/docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ curl https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/in
1515

1616
Powershell (Windows):
1717
```powershell
18-
iwr -useb https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install.ps1 | iex
18+
iwr -useb https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install-windows.ps1 | iex
1919
```
2020

2121
If none of these methods work, you can also install the `docrunner` binary from

0 commit comments

Comments
 (0)