Skip to content

Instantly share code, notes, and snippets.

@dbrtly
Last active August 4, 2025 02:36
Show Gist options
  • Select an option

  • Save dbrtly/b734b18d8b33b73e997d225a8c60bd0b to your computer and use it in GitHub Desktop.

Select an option

Save dbrtly/b734b18d8b33b73e997d225a8c60bd0b to your computer and use it in GitHub Desktop.

Revisions

  1. dbrtly revised this gist Aug 4, 2025. 1 changed file with 10 additions and 16 deletions.
    26 changes: 10 additions & 16 deletions jj-installer.sh
    Original file line number Diff line number Diff line change
    @@ -1,26 +1,20 @@
    #/usr/local/bin/

    apps_dir=.local/bin/
    mkdir -p "${app_dir}"

    if [[ ":$PATH:" == *":$HOME/bin:"* ]]; then
    echo "Your path is correctly set"
    else
    echo "Adding `~/.local/bin` to PATH variable."
    export PATH="${apps_dir}:${PATH}"
    fi

    # download and decompress binary, add executable permission, move app to apps dir
    arch=$(uname -m)
    os_type=$(uname -s | tr '[:upper:]' '[:lower:]')

    # download latest release
    gh release download --repo keanemind/jjk --pattern "*${arch}*${os_type}*" --output - | tar --extract -z
    # set variables
    TAG_NAME=$(gh release list --repo jj-vcs/jj --limit 1 --json tagName | jq -r '.[0].tagName')
    if [[ "$(uname -m)" == *x86* ]]; then ARCH="x86_64"; else ARCH="aarch64"; fi
    OS_TYPE=$(uname -s | tr '[:upper:]' '[:lower:]')

    # download release
    gh release download --repo jj-vcs/jj --pattern "*${TAG_NAME}*${ARCH}*${OS_TYPE}*" --output - | tar --extract -z
    # alternative download command
    # wget "https://github.com/martinvonz/jjk/releases/download/${version}/jj-${version}-${arch}-unknown-linux-musl.tar.gz" -O - | tar -xz
    # wget "https://github.com/jj-vcs/jj/releases/download/${version}/jj-${version}-${arch}-unknown-linux-musl.tar.gz" -O - | tar -xz


    chmod +x jj
    mv jj "${apps_dir}
    mv jj "${XDG_BIN_HOME}"

    # configure auto-completion
    echo "source <(jj util completion)" > ~/.customize_environment
  2. dbrtly revised this gist Aug 3, 2025. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions jj-installer.sh
    Original file line number Diff line number Diff line change
    @@ -15,9 +15,9 @@ arch=$(uname -m)
    os_type=$(uname -s | tr '[:upper:]' '[:lower:]')

    # download latest release
    gh release download --repo martinvonz/jj --pattern "*${arch}*${os_type}*" --output - | tar --extract -z
    gh release download --repo keanemind/jjk --pattern "*${arch}*${os_type}*" --output - | tar --extract -z
    # alternative download command
    # wget "https://github.com/martinvonz/jj/releases/download/${version}/jj-${version}-${arch}-unknown-linux-musl.tar.gz" -O - | tar -xz
    # wget "https://github.com/martinvonz/jjk/releases/download/${version}/jj-${version}-${arch}-unknown-linux-musl.tar.gz" -O - | tar -xz

    chmod +x jj
    mv jj "${apps_dir}
  3. dbrtly renamed this gist Mar 26, 2025. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. dbrtly revised this gist Aug 23, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_jj.sh
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ else
    export PATH="${apps_dir}:${PATH}"
    fi

    # download and decompress binary, add executable permissions, move it to apps dir
    # download and decompress binary, add executable permission, move app to apps dir
    arch=$(uname -m)
    os_type=$(uname -s | tr '[:upper:]' '[:lower:]')

  5. dbrtly revised this gist Aug 23, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_jj.sh
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ mkdir -p "${app_dir}"
    if [[ ":$PATH:" == *":$HOME/bin:"* ]]; then
    echo "Your path is correctly set"
    else
    echo "Your path is missing ~/bin, you might want to add it."
    echo "Adding `~/.local/bin` to PATH variable."
    export PATH="${apps_dir}:${PATH}"
    fi

  6. dbrtly revised this gist Aug 23, 2024. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion install_jj.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,6 @@

    apps_dir=.local/bin/
    mkdir -p "${app_dir}"
    touch ~/.customize_environment

    if [[ ":$PATH:" == *":$HOME/bin:"* ]]; then
    echo "Your path is correctly set"
  7. dbrtly revised this gist Aug 23, 2024. No changes.
  8. dbrtly revised this gist Aug 23, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_jj.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #/usr/local/bin/

    apps_dir="/${HOME}/.local/bin/"
    apps_dir=.local/bin/
    mkdir -p "${app_dir}"
    touch ~/.customize_environment

  9. dbrtly revised this gist Aug 21, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_jj.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #/usr/local/bin/

    apps_dir="${HOME}/.local/bin/"
    apps_dir="/${HOME}/.local/bin/"
    mkdir -p "${app_dir}"
    touch ~/.customize_environment

  10. dbrtly created this gist Aug 21, 2024.
    27 changes: 27 additions & 0 deletions install_jj.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    #/usr/local/bin/

    apps_dir="${HOME}/.local/bin/"
    mkdir -p "${app_dir}"
    touch ~/.customize_environment

    if [[ ":$PATH:" == *":$HOME/bin:"* ]]; then
    echo "Your path is correctly set"
    else
    echo "Your path is missing ~/bin, you might want to add it."
    export PATH="${apps_dir}:${PATH}"
    fi

    # download and decompress binary, add executable permissions, move it to apps dir
    arch=$(uname -m)
    os_type=$(uname -s | tr '[:upper:]' '[:lower:]')

    # download latest release
    gh release download --repo martinvonz/jj --pattern "*${arch}*${os_type}*" --output - | tar --extract -z
    # alternative download command
    # wget "https://github.com/martinvonz/jj/releases/download/${version}/jj-${version}-${arch}-unknown-linux-musl.tar.gz" -O - | tar -xz

    chmod +x jj
    mv jj "${apps_dir}
    # configure auto-completion
    echo "source <(jj util completion)" > ~/.customize_environment