Skip to content

Commit c49275e

Browse files
author
Karl Rieb
committed
Move scripts into a separate directory
1 parent 658d54e commit c49275e

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed
File renamed without changes.

export-generated renamed to scripts/export-generated

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def main():
121121
"""The entry point for the program."""
122122

123123
args = _cmdline_parser.parse_args()
124+
cwd = os.path.dirname(__file__)
124125
repo_path = args.repo_path
125126
def log(msg):
126127
if args.verbose:
@@ -156,18 +157,18 @@ def main():
156157
for filename in get_files_in_repo('.', exclude_ignored_files=True):
157158
target = os.path.join(repo_path, filename)
158159
log('Copying %s to %s' % (filename, target))
159-
subprocess.check_call(['rsync', '-R', filename, repo_path])
160+
subprocess.check_call(['rsync', '-R', filename, repo_path], cwd=cwd)
160161

161162
# Generate source files and copy across to the public repo.
162163
log('Regenerating source files')
163-
subprocess.check_call(['rm', '-rf', 'build/generated-sources'])
164+
subprocess.check_call(['rm', '-rf', 'build/generated-sources'], cwd=cwd)
164165
subprocess.check_output(['./run-stone-codegen'])
165166

166167
target_path = os.path.join(repo_path, 'src/main/java/com/')
167168
log('Copying generated sources to ' + target_path)
168169
subprocess.check_call(['rsync', '-r',
169170
'build/generated-sources/stone/com/',
170-
target_path])
171+
target_path], cwd=cwd)
171172

172173
# Modify the gradle.build for the public repo
173174
log('Modifying gradle.build for the public repo.')

release-check renamed to scripts/release-check

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
#!/bin/bash
2-
3-
DIR=`dirname "${BASE_SOURCE[0]}"`
1+
#!/usr/bin/env bash
42

53
die() {
64
echo >&2 "error: release checks failed"
75
exit 1
86
}
97

8+
# Exit immediately on any error.
9+
set -eufo pipefail
10+
trap die SIGTERM
11+
12+
DIR=`dirname "${BASE_SOURCE[0]}"`
13+
1014
run() {
1115
echo "================================================================================"
1216
echo " CMD: $@"
@@ -51,9 +55,6 @@ if [ ! -f "${AUTH_FILE}" ] ; then
5155
exit 1
5256
fi
5357

54-
trap 'die' ERR
55-
trap 'die' SIGTERM
56-
5758
echo "Running release checks..."
5859
echo ""
5960
echo "A series of tests will be performed to verify package is ready for release."

0 commit comments

Comments
 (0)