-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost-publish-global.sh
More file actions
56 lines (52 loc) · 2.09 KB
/
Copy pathpost-publish-global.sh
File metadata and controls
56 lines (52 loc) · 2.09 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
#!/usr/bin/env bash
# This script is called by the Publish command of the Python maintain CLI tool.
#
# The CLI tool calls this script after all components have been published and the commit message has
# been created. Use this script to run cleanup steps that should be done at a repository level.
#
# A non-zero exit status prevents the publishing process to be continued.
#
# The following stringified arguments are available:
# [1] dry-run {boolean}:
# Is `True` when the user don't want to actually publish anything. Instead this script should
# only report what would have happened for testing and development purposes.
# Otherwise, this property is set to `False`.
# [2] no-git {boolean}:
# Is `True` when the user don't want to actually create any git commits. Instead, changed
# files should be keeps in the index.
# Otherwise, this property is set to `False`.
# [3] components {object[]}:
# Information about all components that have been published, in the format
# ```
# [ {
# "component": {
# "name": string,
# "version": string,
# "location": string,
# "private": boolean
# },
# "new_version": string
# } ]
# ```
# [4] registries {object[]}:
# Information about all selected registries that are targeted during publishing, in the format
# ```
# [ {
# "name": "github" | "npm",
# "url": string
# } ]
# ```
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
source "${__dir}/utils.sh"
# Try to run a custom script of the same name.
# When no script was found, continue and run the default behaviour instead.
try_run_custom_script "$@"
# Show debug output when the publish command is executed in dry-run mode.
if [[ "$1" == "True" ]] ; then
echo "Running script '$0' with the following arguments:"
echo "[1] dry-run = $1"
echo "[2] no-git = $2"
echo "[3] components = $(echo "$3" | npx json)"
echo "[4] registries = $(echo "$4" | npx json)"
fi
# There is no default behaviour for the pre-publish lifecycle!