File tree 3 files changed +42
-32
lines changed
3 files changed +42
-32
lines changed Original file line number Diff line number Diff line change @@ -24,22 +24,6 @@ set -o pipefail
24
24
# The openapi-generator version used by this client
25
25
export OPENAPI_GENERATOR_COMMIT=" v4.3.0"
26
26
27
- # OS X sed doesn't support "--version". This way we can tell if OS X sed is
28
- # used.
29
- if ! sed --version & > /dev/null; then
30
- # OS X sed and GNU sed aren't compatible with backup flag "-i". Namely
31
- # sed -i ... - does not work on OS X
32
- # sed -i'' ... - does not work on certain OS X versions
33
- # sed -i '' ... - does not work on GNU
34
- echo " >>> OS X sed detected, which may be incompatible with this script. Please install and use GNU sed instead:
35
- $ brew install gnu-sed
36
- $ brew info gnu-sed
37
- # Find the path to the installed gnu-sed and add it to your PATH. The default
38
- # is:
39
- # PATH=\" /Users/\$ USER/homebrew/opt/gnu-sed/libexec/gnubin:\$ PATH\" "
40
- exit 1
41
- fi
42
-
43
27
SCRIPT_ROOT=$( dirname " ${BASH_SOURCE} " )
44
28
CLIENT_ROOT=" ${SCRIPT_ROOT} /../kubernetes"
45
29
CLIENT_VERSION=$( python " ${SCRIPT_ROOT} /constants.py" CLIENT_VERSION)
@@ -50,11 +34,14 @@ pushd "${SCRIPT_ROOT}" > /dev/null
50
34
SCRIPT_ROOT=` pwd`
51
35
popd > /dev/null
52
36
37
+ source ${SCRIPT_ROOT} /util/common.sh
38
+ util::common::check_sed
39
+
53
40
pushd " ${CLIENT_ROOT} " > /dev/null
54
41
CLIENT_ROOT=` pwd`
55
42
popd > /dev/null
56
43
57
- TEMP_FOLDER=$( mktemp -d)
44
+ TEMP_FOLDER=$( mktemp -d)
58
45
trap " rm -rf ${TEMP_FOLDER} " EXIT SIGINT
59
46
60
47
SETTING_FILE=" ${TEMP_FOLDER} /settings"
Original file line number Diff line number Diff line change @@ -31,27 +31,15 @@ set -o errexit
31
31
set -o nounset
32
32
set -o pipefail
33
33
34
- # OS X sed doesn't support "--version". This way we can tell if OS X sed is
35
- # used.
36
- if ! sed --version & > /dev/null; then
37
- # OS X sed and GNU sed aren't compatible with backup flag "-i". Namely
38
- # sed -i ... - does not work on OS X
39
- # sed -i'' ... - does not work on certain OS X versions
40
- # sed -i '' ... - does not work on GNU
41
- echo " >>> OS X sed detected, which may be incompatible with this script. Please install and use GNU sed instead:
42
- $ brew install gnu-sed
43
- $ brew info gnu-sed
44
- # Find the path to the installed gnu-sed and add it to your PATH. The default
45
- # is:
46
- # PATH=\" /Users/\$ USER/homebrew/opt/gnu-sed/libexec/gnubin:\$ PATH\" "
47
- exit 1
48
- fi
49
34
50
35
repo_root=" $( git rev-parse --show-toplevel) "
51
36
declare -r repo_root
52
37
cd " ${repo_root} "
53
38
54
39
source scripts/util/changelog.sh
40
+ source scripts/util/common.sh
41
+
42
+ util::common::check_sed
55
43
go get k8s.io/release/cmd/release-notes
56
44
57
45
TARGET_RELEASE=${TARGET_RELEASE:- " v$( grep " ^CLIENT_VERSION = \" " scripts/constants.py | sed " s/CLIENT_VERSION = \" //g" | sed " s/\" //g" ) " }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Copyright 2021 The Kubernetes Authors.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # check_sed returns an error and suggests installing GNU sed, if OS X sed is
18
+ # detected.
19
+ function util::common::check_sed {
20
+ # OS X sed doesn't support "--version". This way we can tell if OS X sed is
21
+ # used.
22
+ if ! sed --version & > /dev/null; then
23
+ # OS X sed and GNU sed aren't compatible with backup flag "-i". Namely
24
+ # sed -i ... - does not work on OS X
25
+ # sed -i'' ... - does not work on certain OS X versions
26
+ # sed -i '' ... - does not work on GNU
27
+ echo " >>> OS X sed detected, which may be incompatible with this script. Please install and use GNU sed instead:
28
+ $ brew install gnu-sed
29
+ $ brew info gnu-sed
30
+ # Find the path to the installed gnu-sed and add it to your PATH. The default
31
+ # is:
32
+ # PATH=\" /Users/\$ USER/homebrew/opt/gnu-sed/libexec/gnubin:\$ PATH\" "
33
+ exit 1
34
+ fi
35
+ }
You can’t perform that action at this time.
0 commit comments