Skip to content

Commit

Permalink
Merge pull request #83 from DudeBro249/dev
Browse files Browse the repository at this point in the history
feat: version 1.2.1
  • Loading branch information
srinivasayush authored Aug 2, 2021
2 parents 79c1086 + b0d6b02 commit 985429c
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
build:
name: Build wheels on ${{ matrix.os }}
name: Build binary on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.2.1 (2021-08-02)

- Version 1.2.1
- Fix powershell installer to get latest release tag dynamically
- Minor changes

## 1.2.0 (2021-08-01)

- Version 1.2.0
Expand All @@ -7,9 +13,9 @@
## 1.1.1 (2021-06-04)

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

## 1.1.0 (2021-06-03)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ curl https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/in

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

If none of these methods work, you can also install the `docrunner` binary from
Expand Down
29 changes: 24 additions & 5 deletions installers/install.ps1 → installers/install-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,37 @@ $ErrorActionPreference = "Stop"
# Defining path to docrunner executable in variable
$DocrunnerDirectory = 'C:\src\Docrunner'

# Function to get the redirected url
Function Get-RedirectedUrl {
Param (
[Parameter(Mandatory=$true)]
[String]$URL
)

$request = [System.Net.WebRequest]::Create($url)
$request.AllowAutoRedirect=$false
$response=$request.GetResponse()

If ($response.StatusCode -eq "Found")
{
$response.GetResponseHeader("Location")
}
}

# Only create Docrunner directory if it does not already exist
if (Test-Path -Path $DocrunnerDirectory) {
Write-Host "$DocrunnerDirectory already exists"
Write-Host "Not creating directory"
Write-Host "$DocrunnerDirectory already exists, no need to create directory"
Write-Host ""
} else {
new-item $DocrunnerDirectory -itemtype directory
}

# Download docrunner.exe from github releases
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
$LATEST_RELEASE_URL = Get-RedirectedUrl -URL 'https://github.com/DudeBro249/docrunner/releases/latest'
$LATEST_RELEASE_TAG = $LATEST_RELEASE_URL.Split("/")[7]
$DOCRUNNER_BINARY_URL = "https://github.com/DudeBro249/docrunner/releases/download/$LATEST_RELEASE_TAG/docrunner-windows.exe"

Start-BitsTransfer $DOCRUNNER_BINARY_URL "$DocrunnerDirectory\docrunner.exe" -Description "Downloading Docrunner from $DOCRUNNER_BINARY_URL" -DisplayName 'Downloading Docrunner' -TransferType Download

Write-Host 'Installing Docrunner' -ForegroundColor cyan

Expand All @@ -31,8 +51,7 @@ if ($UserPath -ne $null)
if ($UserPath -split ';' -contains $DocrunnerDirectory)
{
Write-Host ""
Write-Host "$DocrunnerDirectory already exists in PATH"
Write-Host "No need to add it"
Write-Host "$DocrunnerDirectory already exists in PATH, no need to add it"
Write-Host ""
}
else
Expand Down
11 changes: 7 additions & 4 deletions lib/commands/self/update.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@ class UpdateCommand extends Command {
var outputMessage = 'Copy and paste this command into your terminal: ';
if (Platform.isWindows) {
installationCommand =
'iwr -useb https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install.ps1 | iex';
'iwr -useb https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install-windows.ps1 | iex';
outputMessage =
'Copy and paste this command into your powershell terminal';
} else if (Platform.isMacOS || Platform.isLinux) {
} else if (Platform.isLinux) {
installationCommand =
'curl -fsSL https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install.sh | sh';
'curl https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install-linux.sh | sudo bash';
} else if (Platform.isMacOS) {
installationCommand =
'curl https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/install-mac.sh | sudo bash';
}

stdout.writeln(
Colorize(
'$outputMessage\n',
'\n$outputMessage\n',
).green(),
);
stdout.writeln('$installationCommand\n');
Expand Down
2 changes: 1 addition & 1 deletion lib/constants/version.dart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
const version = '1.1.1';
const version = '1.2.1';
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: docrunner
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.
version: 1.2.0
version: 1.2.1
homepage: https://github.com/DudeBro249/docrunner

environment:
Expand Down
2 changes: 1 addition & 1 deletion website/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ curl https://raw.githubusercontent.com/DudeBro249/docrunner/stable/installers/in

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

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

0 comments on commit 985429c

Please sign in to comment.