-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.sh
executable file
·86 lines (73 loc) · 2.2 KB
/
configure.sh
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
83
84
85
86
#!/usr/bin/env bash
source lib/util.sh
[ -n "$ENV_NAME" ] || ENV_NAME=development
echo "Environment: $ENV_NAME"
[ -n "$1" ] && PREFIX=$1
[ -n "$PREFIX" ] || PREFIX=.
echo "Prefix: $PREFIX"
[ "." != "$PREFIX" ] && V_SH_SHARE=$PREFIX/share/git-versioning || V_SH_SHARE=$PREFIX
echo "Location: $V_SH_SHARE"
P=$(echo $PREFIX | sed 's/\//\\\//g')
sed_rewrite_tag 's/^PREFIX=.*/PREFIX='$P'/' install.sh
[ "." != "$PREFIX" ] \
&& sed_rewrite_tag 's/^bin=.*/bin=git-versioning/' test/git-versioning-spec.bats \
|| sed_rewrite_tag 's/^bin=.*/bin=bin\/cli-version.sh/' test/git-versioning-spec.bats
P=$(echo $V_SH_SHARE | sed 's/\//\\\//g')
sed_rewrite_tag 's/^V_SH_SHARE=.*/V_SH_SHARE='$P'/' install.sh
sed_rewrite_tag 's/^V_SH_SHARE=.*/V_SH_SHARE='$P'/' bin/cli-version.sh
echo "Rewrote installer and bin/cli-version include paths"
# reset .versioned-files.list
(
cat <<HEREDOC
ReadMe.rst
# Edit configure.sh to change this list!
package.yaml
bin/cli-version.sh
lib/git-versioning.sh
lib/util.sh
lib/formats.sh
local-formats.sh
tools/ci/build.sh
tools/git-hooks/prepare-commit-msg.sh
tools/git-hooks/pre-commit.sh
tools/git-hooks/pre-push.sh
tools/cmd/version-check.sh
tools/cmd/prep-version.sh
tools/cmd/src-files.sh
tools/cmd/src-tree.sh
tools/cmd/append-version-to-commit-msg.sh
Makefile
Rules.mk
Rules.git-versioning.mk
Rules.git-versioning.shared.mk
Rules.git-hooks.shared.mk
test/git-versioning-spec.bats
test/helpers.bash
tools/sh/sync-lib.sh
HEREDOC
) > .versioned-files.list
echo "Reset .versioned-files.list"
# for dev and test add test files
[ "$ENV_NAME" == "production" ] || {
(
cat <<HEREDOC
test/example/build.xml
test/example/clike_line_comment_id.js
test/example/clike_line_comment_id.pug
test/example/coffee_var_version.coffee
test/example/js_var_version.js
test/example/json_version.json
test/example/mk_var_version.mk
test/example/properties_version.properties
test/example/py_mod.py
test/example/rst_field_id.rst
test/example/rst_field_version.rst
test/example/sh_var_version.sh
test/example/unix_comment_id.sh
test/example/unix_comment_version.sh
test/example/yaml_version.yaml
HEREDOC
) >> .versioned-files.list
echo "Test files appended to .versioned-files.list"
}
# Id: git-versioning/0.0.27-master configure.sh