copy dist
This commit is contained in:
15
dbg.clone
15
dbg.clone
@@ -3,16 +3,17 @@ SDIR=$(cd "$(dirname "$0")" ; pwd -P)
|
||||
|
||||
DST_DIR=/Users/mk/test-dist
|
||||
MAIN_BRANCH=main
|
||||
REPO_DIR=/Users/mk/test-repo
|
||||
REPO_URL=https://github.com/kornerr/ru
|
||||
TMP_BRANCHES=/tmp/dbg-branches
|
||||
|
||||
# Clone since the directory does not exist
|
||||
if [ ! -d "$DST_DIR" ]; then
|
||||
git clone $REPO_URL $DST_DIR
|
||||
if [ ! -d "$REPO_DIR" ]; then
|
||||
git clone $REPO_URL $REPO_DIR
|
||||
fi
|
||||
|
||||
# ?? Pull the latest changes
|
||||
cd $DST_DIR
|
||||
# Get the latest changes
|
||||
cd $REPO_DIR
|
||||
git checkout -f $MAIN_BRANCH
|
||||
git fetch --all
|
||||
|
||||
@@ -22,5 +23,9 @@ git fetch --all
|
||||
cmt=`git branch -av --sort=-committerdate | tr -s ' ' | head -n1 | cut -d' ' -f3`
|
||||
echo "Latest commit: $cmt"
|
||||
|
||||
# Switch to the latest branch
|
||||
# Switch to the latest commit
|
||||
git checkout $cmt
|
||||
|
||||
# Copy dist
|
||||
mkdir -p $DST_DIR
|
||||
cp -R dist/* $DST_DIR
|
||||
|
||||
Reference in New Issue
Block a user