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