File tree Expand file tree Collapse file tree 3 files changed +42
-32
lines changed Expand file tree Collapse file tree 3 files changed +42
-32
lines changed Original file line number Diff line number Diff line change @@ -24,22 +24,6 @@ set -o pipefail
2424# The openapi-generator version used by this client
2525export OPENAPI_GENERATOR_COMMIT=" v4.3.0"
2626
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-
4327SCRIPT_ROOT=$( dirname " ${BASH_SOURCE} " )
4428CLIENT_ROOT=" ${SCRIPT_ROOT} /../kubernetes"
4529CLIENT_VERSION=$( python " ${SCRIPT_ROOT} /constants.py" CLIENT_VERSION)
@@ -50,11 +34,14 @@ pushd "${SCRIPT_ROOT}" > /dev/null
5034SCRIPT_ROOT=` pwd`
5135popd > /dev/null
5236
37+ source ${SCRIPT_ROOT} /util/common.sh
38+ util::common::check_sed
39+
5340pushd " ${CLIENT_ROOT} " > /dev/null
5441CLIENT_ROOT=` pwd`
5542popd > /dev/null
5643
57- TEMP_FOLDER=$( mktemp -d)
44+ TEMP_FOLDER=$( mktemp -d)
5845trap " rm -rf ${TEMP_FOLDER} " EXIT SIGINT
5946
6047SETTING_FILE=" ${TEMP_FOLDER} /settings"
Original file line number Diff line number Diff line change @@ -31,27 +31,15 @@ set -o errexit
3131set -o nounset
3232set -o pipefail
3333
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
4934
5035repo_root=" $( git rev-parse --show-toplevel) "
5136declare -r repo_root
5237cd " ${repo_root} "
5338
5439source scripts/util/changelog.sh
40+ source scripts/util/common.sh
41+
42+ util::common::check_sed
5543go get k8s.io/release/cmd/release-notes
5644
5745TARGET_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