commit | fa17ee3892ec689f26ee129aff1b813bfb537ff9 | [log] [tgz] |
---|---|---|
author | Gary Miguel <garymm@google.com> | Fri Jun 19 10:55:38 2020 -0700 |
committer | Gary Miguel <garymm@google.com> | Fri Jun 19 10:59:50 2020 -0700 |
tree | 9c788e17c67ed90776fab3235d7aa044029e55ae | |
parent | bcf8ea5173c2b19fa36dd20a75e02978c0db7ad3 [diff] |
Make sed command work on both linux and mac Bug: 53031 Change-Id: I46bc08bfa7e2254e03aaff8d8811cf4b40fd0cf2
This contains configuration useful in updating the black package in CIPD.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install pyoxidizer
BLACK_VERSION=$(pip3 install black== 2>&1 | grep versions: | sed -E 's/.*, ([a-z0-9\.]+)\)/\1/') # We have to specify a back-up to make this work on both Linux and MacOS: # https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux sed -E -e "s/black==[^\"]+\"/black==${BLACK_VERSION}\"/" -i.bak ./pyoxidizer.bzl rm ./pyoxidizer.bzl.bak pyoxidizer build install OS=$(if [[ $(uname) == 'Darwin' ]]; then echo 'mac'; else echo 'linux'; fi) cipd create -tag version:${BLACK_VERSION} -pkg-def ./cipd-${OS}.yaml