From ad118013efcc25ecc328a434bd98c494a7d93f22 Mon Sep 17 00:00:00 2001 From: John Ky Date: Sat, 18 May 2019 21:48:22 +1000 Subject: [PATCH] Remove scripts directory --- scripts/autotag | 39 ---------------------- scripts/fetch | 38 --------------------- scripts/ghc-version | 17 ---------- scripts/mk-cabal-project | 5 --- scripts/package-name | 3 -- scripts/projects-summary | 3 -- scripts/publish | 33 ------------------- scripts/resolver | 12 ------- scripts/setup-cred | 9 ----- scripts/up | 71 ---------------------------------------- scripts/when | 18 ---------- 11 files changed, 248 deletions(-) delete mode 100755 scripts/autotag delete mode 100755 scripts/fetch delete mode 100755 scripts/ghc-version delete mode 100755 scripts/mk-cabal-project delete mode 100755 scripts/package-name delete mode 100755 scripts/projects-summary delete mode 100755 scripts/publish delete mode 100755 scripts/resolver delete mode 100755 scripts/setup-cred delete mode 100755 scripts/up delete mode 100755 scripts/when diff --git a/scripts/autotag b/scripts/autotag deleted file mode 100755 index 94f4754..0000000 --- a/scripts/autotag +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash - -if [ "$_system_type" == "Darwin" ]; then - sed () { - gsed "$@" - } -fi - -_repo_name=$(basename `git rev-parse --show-toplevel`) - -_version="$(cat package.yaml | grep '^version:' | head -n 1 | cut -d : -f 2 | xargs)" - -_branch=$(git rev-parse --abbrev-ref HEAD) -_branch_prefix=${_branch%-branch} - -if [[ $(git ls-remote origin "refs/tags/v$_version") ]]; then - echo "The tag v$_version already exists. Will not tag" - exit 0 -fi - -_commit=$(git rev-parse --verify HEAD) - -_release_data=$(cat < /dev/null - -cp ../$_project.cabal ./ - -projects() { - for x in $(direct_deps | sort | uniq); do - cabal install $x --dry-run | grep -v "^${_project}-[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+$" | tail -n 1 - done -} - -if grep '^ *# extra-deps-insertion-point' ../stack.yaml; then - _indent="$(grep '^ *# extra-deps-insertion-point' ../stack.yaml | head -n 1 | cut -d '#' -f 1 | tr -d '\n')" - projects | sort | uniq | sed "s|^|$_indent- |g" > stack-b.yaml - grep '^ *# extra-deps-insertion-point' -B 1000 ../stack.yaml > stack-a.yaml - grep '^ *# extra-deps-insertion-point' -A 1000 ../stack.yaml | grep -v '^ *# extra-deps-insertion-point' > stack-c.yaml -else - cp ../stack.yaml stack-a.yaml - rm -f stack-b.yaml; touch stack-b.yaml - echo > stack-c.yaml -fi - -cat stack-a.yaml stack-b.yaml stack-c.yaml > ../stack-ci.yaml - -popd > /dev/null diff --git a/scripts/ghc-version b/scripts/ghc-version deleted file mode 100755 index 6258371..0000000 --- a/scripts/ghc-version +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -_resolver="$1" - -download_snapshot () { - local _resolver="$1" - - if [[ $_resolver == lts-* ]]; then - curl -s https://raw.githubusercontent.com/fpco/lts-haskell/master/${_resolver}.yaml \ - | grep 'ghc:' | head -n 1 | cut -d ':' -f 2 | xargs echo -n 2> /dev/null - elif [[ $_resolver == nightly-* ]]; then - curl -s https://raw.githubusercontent.com/fpco/stackage-nightly/master/${_resolver}.yaml \ - | grep 'ghc:' | head -n 1 | cut -d ':' -f 2 | xargs echo -n 2> /dev/null - fi -} - -download_snapshot "${_resolver}" diff --git a/scripts/mk-cabal-project b/scripts/mk-cabal-project deleted file mode 100755 index e7082c9..0000000 --- a/scripts/mk-cabal-project +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -cat < ${cred} -fi diff --git a/scripts/up b/scripts/up deleted file mode 100755 index 9739cca..0000000 --- a/scripts/up +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash - -if [ "$_system_type" == "Darwin" ]; then - sed () { - gsed "$@" - } -fi - -_repo_name=$(basename `git rev-parse --show-toplevel`) - -_version=$( - cat $_repo_name.cabal | grep '^version:' | head | cut -d ':' -f 2 | xargs -) - -_major=$( - echo $_version | sed 's|^\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)|\1|g' -) - -_minor=$( - echo $_version | sed 's|^\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)|\2|g' -) - -_point=$( - echo $_version | sed 's|^\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)|\3|g' -) - -_patch=$( - echo $_version | sed 's|^\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)|\4|g' -) - - -case $1 in -major) - _new_version="$(($_major + 1)).0.0.0" - _new_branch="$(($_major + 1))" - ;; -minor) - _new_version="$_major.$(($_minor + 1)).0.0" - ;; -point) - _new_version="$_major.$_minor.$(($_point + 1)).0" - ;; -patch) - _new_version="$_major.$_minor.$_point.$(($_patch + 1))" - ;; -*) - echo "./scripts/up (major|minor|point|patch)" - exit 1 -esac - -sed "s|^\(version:\s*\)\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)$|\1$_new_version|g" -i $_repo_name.cabal - -echo "Cabal project version upgrade to $_new_version" -echo "" -echo "Please review and run the following commands:" -echo "" - -if [ "$_new_branch" != "" ]; then - echo " git checkout -b ${_new_branch}-branch" -fi - -echo " git add $_repo_name.cabal" -echo " git commit -m 'New version $_new_version'" - -if [ "$_new_branch" != "" ]; then - echo " git push --set-upstream origin ${_new_branch}-branch" -else - echo " git push origin" -fi - -echo "" diff --git a/scripts/when b/scripts/when deleted file mode 100755 index 43fcc4d..0000000 --- a/scripts/when +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -set -e - -_expected_stage="$1" - -if [ "$BUILD_STAGES" == "" ]; then - BUILD_STAGES=all -fi - -for stage in $BUILD_STAGES; do - if [ "$stage" == "$_expected_stage" ] || [ "$stage" == "all" ]; then - shift 1 - "$@" - - break - fi -done