-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add flake for development, fix download url, new list-all script
- Loading branch information
Showing
10 changed files
with
129 additions
and
64 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eval "$(lorri direnv)" | ||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.direnv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
#!/usr/bin/env bash | ||
set -eo pipefail | ||
|
||
set -euo pipefail | ||
cmd="curl --silent --location" | ||
releases_path="https://api.github.com/repos/telepresenceio/telepresence/releases?per_page=100" | ||
|
||
# stolen from https://github.com/rbenv/ruby-build/pull/631/files#diff-fdcfb8a18714b33b07529b7d02b54f1dR942 | ||
function sort_versions() { | ||
if [ -n "$GITHUB_API_TOKEN" ]; then | ||
cmd="$cmd --header 'Authorization: token $GITHUB_API_TOKEN'" | ||
fi | ||
|
||
sort_versions() { | ||
sed 'h; s/[+-]/./g; s/.p\([[:digit:]]\)/.z\1/; s/$/.z/; G; s/\n/ /' | | ||
LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n -k 4,4n -k 5,5n | awk '{print $2}' | ||
} | ||
|
||
list_all_versions() { | ||
git ls-remote --tags --refs https://github.com/telepresenceio/telepresence.git | | ||
grep -o 'refs/tags/.*' | | ||
cut -d/ -f3- | | ||
sed 's/^v//' | ||
} | ||
versions=$( | ||
eval "$cmd $releases_path" | | ||
grep -o '"name": "v.*' | | ||
sed 's/"name": "v\(.*\)",/\1/' | | ||
grep -E '[0-9]+.[0-9]+.[0-9]+$' | | ||
xargs | ||
) | ||
|
||
list_all_versions | sort_versions | xargs echo | ||
echo "$versions" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
description = "my project description"; | ||
|
||
inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
|
||
outputs = { self, nixpkgs, flake-utils }: | ||
flake-utils.lib.eachDefaultSystem | ||
(system: | ||
let pkgs = nixpkgs.legacyPackages.${system}; in | ||
{ | ||
devShells.default = pkgs.mkShell { | ||
buildInputs = [ | ||
pkgs.asdf-vm | ||
pkgs.shfmt | ||
pkgs.shellcheck | ||
]; | ||
}; | ||
} | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ pkgs ? import <nixpkgs> {} }: | ||
|
||
pkgs.mkShell { | ||
buildInputs = [ | ||
pkgs.hello | ||
|
||
# keep this line if you use bash | ||
pkgs.bashInteractive | ||
]; | ||
} |