From adef52a938d9d50b9bb93808aff56d806f66262c Mon Sep 17 00:00:00 2001 From: Qubasa Date: Thu, 30 May 2024 22:41:30 +0200 Subject: [PATCH 1/3] docs: Fix installer wrong indentation --- docs/site/getting-started/installer.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/site/getting-started/installer.md b/docs/site/getting-started/installer.md index c7a6c5e77..f24df7961 100644 --- a/docs/site/getting-started/installer.md +++ b/docs/site/getting-started/installer.md @@ -54,9 +54,9 @@ sudo umount /dev/sdb1 flash-installer ``` - The `--ssh-pubkey`, `--language` and `--keymap` are optional. - Replace `$HOME/.ssh/id_ed25519.pub` with a path to your SSH public key. - If you do not have an ssh key yet, you can generate one with `ssh-keygen -t ed25519` command. + The `--ssh-pubkey`, `--language` and `--keymap` are optional. + Replace `$HOME/.ssh/id_ed25519.pub` with a path to your SSH public key. + If you do not have an ssh key yet, you can generate one with `ssh-keygen -t ed25519` command. !!! Danger "Specifying the wrong device can lead to unrecoverable data loss." From a8762522c859d16a45826795b493e7e269404966 Mon Sep 17 00:00:00 2001 From: Qubasa Date: Thu, 30 May 2024 23:29:59 +0200 Subject: [PATCH 2/3] tea-create-pr: Better username detection --- pkgs/tea-create-pr/default.nix | 2 -- pkgs/tea-create-pr/script.sh | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/tea-create-pr/default.nix b/pkgs/tea-create-pr/default.nix index 723bf6eb0..a22b9a282 100644 --- a/pkgs/tea-create-pr/default.nix +++ b/pkgs/tea-create-pr/default.nix @@ -4,7 +4,6 @@ coreutils, git, tea, - gawk, openssh, }: writeShellApplication { @@ -15,7 +14,6 @@ writeShellApplication { git tea openssh - gawk ]; text = builtins.readFile ./script.sh; } diff --git a/pkgs/tea-create-pr/script.sh b/pkgs/tea-create-pr/script.sh index ac02d31aa..7e6bbaab9 100755 --- a/pkgs/tea-create-pr/script.sh +++ b/pkgs/tea-create-pr/script.sh @@ -7,10 +7,12 @@ targetBranch="${3:-main}" shift && shift TMPDIR="$(mktemp -d)" currentBranch="$(git rev-parse --abbrev-ref HEAD)" -user="$(git config --get remote.origin.url | awk -F'[@:/]' '{print $3}' | tr -d '\n')" +user_unparsed="$(tea whoami)" +user="$(echo "$user_unparsed" | tr -d '\n' | cut -f4 -d' ')" tempRemoteBranch="$user-$currentBranch" root_dir=$(git rev-parse --show-toplevel) + # Function to check if a remote exists check_remote() { if git remote get-url "$1" > /dev/null 2>&1; then @@ -29,6 +31,7 @@ if ! check_remote "$remoteUpstream"; then fi upstream_url=$(git remote get-url "$remoteUpstream") +git fetch "$remoteUpstream" repo=$(echo "$upstream_url" | sed -E 's#.*:([^/]+/[^.]+)\.git#\1#') treefmt -C "$root_dir" From 01a4748d6b6dbdc36e71df63ed48b33cd24bd6a2 Mon Sep 17 00:00:00 2001 From: Qubasa Date: Thu, 30 May 2024 23:37:53 +0200 Subject: [PATCH 3/3] tea-create-pr: Fix non working assignees label --- pkgs/tea-create-pr/script.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/tea-create-pr/script.sh b/pkgs/tea-create-pr/script.sh index 7e6bbaab9..a18351d86 100755 --- a/pkgs/tea-create-pr/script.sh +++ b/pkgs/tea-create-pr/script.sh @@ -4,7 +4,7 @@ set -euo pipefail remoteFork="${1:-origin}" remoteUpstream="${2:-upstream}" targetBranch="${3:-main}" -shift && shift +shift && shift && shift TMPDIR="$(mktemp -d)" currentBranch="$(git rev-parse --abbrev-ref HEAD)" user_unparsed="$(tea whoami)" @@ -51,6 +51,7 @@ fi git push --force -u "$remoteFork" HEAD:refs/heads/"$tempRemoteBranch" +set -x tea pr create \ --repo "$repo" \ --head "$user:$tempRemoteBranch" \