aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/angular-seed/publish.sh
blob: 94498d67f39e65f632965b01950a14c9c3dd6eb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash

# Script for updating angular-seed repo from current local build.

echo "#################################"
echo "## Update angular-seed ###"
echo "#################################"

ARG_DEFS=(
  "--action=(prepare|publish)"
  "[--no-test=(true|false)]"
)

function init {
  TMP_DIR=$(resolveDir ../../tmp)
  BUILD_DIR=$(resolveDir ../../build)
  REPO_DIR=$TMP_DIR/angular-seed
  NEW_VERSION=$(cat $BUILD_DIR/version.txt)
}

function prepare {
  echo "-- Cloning angular-seed"
  git clone git@github.com:angular/angular-seed.git $REPO_DIR

  #
  # copy the files from the build
  #
  echo "-- Updating angular-seed"
  cd $REPO_DIR
  ./scripts/update-angular.sh $BUILD_DIR

  # Test
  if [[ $NO_TEST != "true" ]]; then
    ./scripts/test-all.sh
  fi
}

function publish {
  cd $REPO_DIR
  echo "-- Pushing angular-seed"
  git push origin master
}

source $(dirname $0)/../utils.inc