fixed checkout scripts
This commit is contained in:
42
checkout.bat
42
checkout.bat
@@ -1,11 +1,45 @@
|
||||
echo off
|
||||
|
||||
git clone https://bitbucket.org/%1/i399 .\.tmp
|
||||
set USER=%1
|
||||
set TAG=%2
|
||||
set TMP=./.tmp
|
||||
set SUB_DIR=
|
||||
|
||||
cd .\.tmp
|
||||
if "%1" == "" (
|
||||
echo Usage: %0 user_name tag
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
git checkout %2
|
||||
if "%TAG%" == "hw3" (
|
||||
echo hw3 not implemented yet
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
if "%TAG%" == "hw4" (
|
||||
echo hw4 not implemented yet
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if "%TAG%" == "hw2" (
|
||||
set SUB_DIR=ng1
|
||||
)
|
||||
|
||||
if "%SUB_DIR%" == "" (
|
||||
echo unknown tag
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
git clone https://bitbucket.org/%USER%/i399 %TMP%
|
||||
|
||||
if %errorlevel% neq 0 exit /b 1
|
||||
|
||||
cd %TMP%
|
||||
|
||||
git checkout %TAG%
|
||||
|
||||
if %errorlevel% neq 0 exit /b 1
|
||||
|
||||
cd %SUB_DIR%
|
||||
|
||||
call npm install
|
||||
|
||||
|
||||
28
checkout.sh
28
checkout.sh
@@ -2,6 +2,30 @@
|
||||
|
||||
set -e
|
||||
|
||||
git clone https://bitbucket.org/$1/i399 ./.tmp
|
||||
USER=$1
|
||||
TAG=$2
|
||||
TMP="./.tmp"
|
||||
SUB_DIR=""
|
||||
|
||||
(cd ./.tmp && git checkout $2 && npm install && npm start)
|
||||
if [ $# -eq 0 ];then
|
||||
echo "Usage: $0 <user_name> <tag>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $TAG == "hw3" ] || [ $TAG == "hw4" ]; then
|
||||
echo 'not implemented yet'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $TAG == "hw2" ]; then
|
||||
SUB_DIR="ng1"
|
||||
fi
|
||||
|
||||
if [ -z $SUB_DIR ]; then
|
||||
echo 'unknown tag'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git clone https://bitbucket.org/$USER/i399 $TMP
|
||||
|
||||
(cd "$TMP" && git checkout $TAG && cd "$SUB_DIR" && npm install && npm start)
|
||||
|
||||
Reference in New Issue
Block a user