From d07f160bae748df617318c21ab34e3274e15150d Mon Sep 17 00:00:00 2001 From: toshi0383 Date: Mon, 26 Feb 2018 19:19:48 +0900 Subject: [PATCH] Fix archive.sh and Makefile --- Makefile | 11 ++++++----- scripts/archive.sh | 21 +++++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 161155b4..787c0430 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ -TOOL_NAME = xcodegen +export TOOL_NAME = XcodeGen +export TOOL_NAME_LOWER = xcodegen VERSION = 1.6.0 PREFIX = /usr/local -INSTALL_PATH = $(PREFIX)/bin/$(TOOL_NAME) -SHARE_PATH = $(PREFIX)/share/$(TOOL_NAME) +INSTALL_PATH = $(PREFIX)/bin/$(TOOL_NAME_LOWER) +SHARE_PATH = $(PREFIX)/share/$(TOOL_NAME_LOWER) CURRENT_PATH = $(PWD) -REPO = https://github.com/yonaskolb/$(TOOL_NAME) +REPO = https://github.com/yonaskolb/$(TOOL_NAME_LOWER) RELEASE_TAR = $(REPO)/archive/$(VERSION).tar.gz SHA = $(shell curl -L -s $(RELEASE_TAR) | shasum -a 256 | sed 's/ .*//') @@ -13,7 +14,7 @@ SHA = $(shell curl -L -s $(RELEASE_TAR) | shasum -a 256 | sed 's/ .*//') install: build mkdir -p $(PREFIX)/bin - cp -f .build/release/$(TOOL_NAME) $(INSTALL_PATH) + cp -f .build/release/$(TOOL_NAME_LOWER) $(INSTALL_PATH) mkdir -p $(SHARE_PATH) cp -R $(CURRENT_PATH)/SettingPresets $(SHARE_PATH)/SettingPresets diff --git a/scripts/archive.sh b/scripts/archive.sh index 8b69dc79..5034f588 100755 --- a/scripts/archive.sh +++ b/scripts/archive.sh @@ -1,11 +1,11 @@ #!/bin/bash -TOOL_NAME=XcodeGen -TOOL_NAME_LOWER=xcodegen -TMP=$(mktemp -d)/$TOOL_NAME +TMP=$(mktemp -d)/${TOOL_NAME:?} BINDIR=$TMP/bin SHAREDIR=$TMP/share -ZIPFILE=$TMP/$TOOL_NAME_LOWER.zip -INSTALLSH=scripts/install-binary.sh +ZIPFILE=$TMP/${TOOL_NAME_LOWER:?}.zip +INSTALLSH=scripts/install.sh + +# copy mkdir -p $BINDIR cp -f .build/release/$TOOL_NAME_LOWER $BINDIR @@ -13,13 +13,18 @@ cp -f .build/release/$TOOL_NAME_LOWER $BINDIR mkdir -p $SHAREDIR cp -R SettingPresets $SHAREDIR/SettingPresets -sed -e 's/^BASE_DIR=.*/BASE_DIR=$(cd `dirname $0`; pwd)/' -e '/.*[zZ][iI][pP].*/d' $INSTALLSH \ - > $TMP/install.sh -chmod +x $TMP/install.sh +cp $INSTALLSH $TMP + +# zip (cd $TMP/..; zip -r $ZIPFILE $TOOL_NAME) + +# print sha + SHA=$(cat $ZIPFILE | shasum -a 256 | sed 's/ .*//') echo "SHA: $SHA" mv $ZIPFILE . +# cleanup + rm -rf $TMP