From 2e30b8cbd1ea0e208277ec2068e4087d3ee6dbd9 Mon Sep 17 00:00:00 2001 From: Jes Olson Date: Sun, 17 Jul 2022 11:25:57 -0500 Subject: [PATCH] Auto push remotes & symlink chtf --- .config/git/config | 2 ++ bin/chtf | 41 +---------------------------------------- 2 files changed, 3 insertions(+), 40 deletions(-) mode change 100755 => 120000 bin/chtf diff --git a/.config/git/config b/.config/git/config index 26b48c4..b033880 100644 --- a/.config/git/config +++ b/.config/git/config @@ -38,6 +38,8 @@ email = j3s@c3f.net [pull] ff = only +[push] + autoSetupRemote = true [pager] status = true [init] diff --git a/bin/chtf b/bin/chtf deleted file mode 100755 index 9dbdd2f..0000000 --- a/bin/chtf +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# list installed tf versions + -# switch terraform versions + -# + download tf if not found - -tf_version="$1" -tf_install_dir="${HOME}/.local/share/chtf" -tf_link_name="${HOME}/bin/terraform" - -# make some os assumptions -if [ "$(uname)" = "Linux" ]; then - os="linux" -else - os="darwin" -fi - -mkdir -p "$tf_install_dir" - -if [ -z "$tf_version" ]; then - # if no arguments, list versions of tf plus list symlink pointer. - printf "available:\n" - ls "$tf_install_dir" - printf "active:\n" - if [ -e "$tf_link_name" ]; then - readlink "$tf_link_name" | xargs basename - fi -else - if [ ! -f "${tf_install_dir}/${tf_version}" ]; then - # download tf version if not found - printf "terraform version not found. downloading...\n" - dl="https://releases.hashicorp.com/terraform/${tf_version}/terraform_${tf_version}_${os}_amd64.zip" - printf "downloading %s\n" "$dl" - curl -L --output /tmp/tf.zip "$dl" - unzip /tmp/tf.zip -d /tmp - mv /tmp/terraform "${tf_install_dir}/${tf_version}" - rm /tmp/tf.zip - fi - ln -sf "${tf_install_dir}/${tf_version}" "$tf_link_name" -fi diff --git a/bin/chtf b/bin/chtf new file mode 120000 index 0000000..33742cb --- /dev/null +++ b/bin/chtf @@ -0,0 +1 @@ +/home/j3s/code/chtf/chtf \ No newline at end of file -- 2.51.2