-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
82 lines (66 loc) · 2.47 KB
/
configure.ac
File metadata and controls
82 lines (66 loc) · 2.47 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
AC_INIT
AC_ARG_WITH([force],
[AS_HELP_STRING([--with-force],
[apply force wherever necessary @<:@default=@:>@])],
[ARG_FORCE='--force'],
[ARG_FORCE=''])
AC_ARG_WITH([submodule-deinit],
[AS_HELP_STRING([--with-submodule-deinit],
[deinitialize submodules before initializing @<:@default=no@:>@])],
[ARG_SUBMODULE_DEINIT='yes'],
[ARG_SUBMODULE_DEINIT='no'])
AC_CHECK_PROGS([GIT], [git], [no])
AS_IF([test "$GIT" == "no"],
[AC_MSG_ERROR([install Git, before continuing.])])
AC_CHECK_PROGS([NODE], [node], [no])
AS_IF([test "$NODE" == "no"],
[AC_MSG_ERROR([install Node.js (node), before continuing.])])
AC_CHECK_PROGS([NPM], [npm], [no])
AS_IF([test "$NPM" == "no"],
[AC_MSG_ERROR([install npm, before continuing.])])
AC_CHECK_PROGS([MAKE], [make], [no])
AS_IF([test "$NPM" == "no"],
[AC_MSG_ERROR([install GNU Make (make), before continuing.])])
AC_MSG_CHECKING([env for BITBUCKET_WORKSPACE])
if ! test -z "$BITBUCKET_WORKSPACE"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([BITBUCKET_WORKSPACE in env is required for publishing])
fi
AC_MSG_CHECKING([env for BITBUCKET_REPO_SLUG])
if ! test -z "$BITBUCKET_REPO_SLUG"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([BITBUCKET_REPO_SLUG in env is required for publishing])
fi
AC_MSG_CHECKING([env for BITBUCKET_ACCESS_TOKEN])
if ! test -z "$BITBUCKET_ACCESS_TOKEN"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([BITBUCKET_ACCESS_TOKEN in env is required for publishing])
fi
# fail fast
set -e
sh -xc "npm --version"
sh -xc "node --version"
sh -xc "git --version"
AC_MSG_NOTICE([initializing npm project...])
npm install
# this allows for caching the directory. Git is able to determine that the
# submodule has been initialized through a copy operation, therefore we need to
# tell Git to drop it. This won't hurt the cache, as we explicitly check out
# commits, therefore the files are guaranteed to be the same
if test "$ARG_SUBMODULE_DEINIT" '=' 'yes'; then
if ! test -z "$ARG_FORCE"; then
AC_MSG_NOTICE([forcefully deinitializing (dangling) git submodules...])
else
AC_MSG_NOTICE([deinitializing (dangling) git submodules...])
fi
git submodule deinit --all $ARG_FORCE
fi
AC_MSG_NOTICE([initializing git submodules...])
git submodule update --init --remote --recursive
AC_OUTPUT