rclone/vendor/github.com/dropbox/dropbox-sdk-go-unofficial/generator/generate-sdk.sh
Nick Craig-Wood 6427029c4e vendor: update all dependencies
* Update all dependencies
  * Remove all `[[constraint]]` from Gopkg.toml
  * Add in the minimum number of `[[override]]` to build
  * Remove go get of github.com/inconshreveable/mousetrap as it is vendored
  * Update docs with new policy on constraints
2018-05-05 15:52:24 +01:00

27 lines
715 B
Bash
Executable File

#! /usr/bin/env bash
set -euo pipefail
if [[ $# -gt 1 ]]; then
echo "$0: Not expecting any command-line arguments, got $#." 1>&2
exit 1
fi
loc=$(realpath -e $0)
base_dir=$(dirname "$loc")
spec_dir="$base_dir/dropbox-api-spec"
gen_dir=$(dirname ${base_dir})/dropbox
stone -v -a :all go_types.stoneg.py "$gen_dir" "$spec_dir"/*.stone
stone -v -a :all go_client.stoneg.py "$gen_dir" "$spec_dir"/*.stone
# Update SDK and API spec versions
sdk_version=${1:-"3.0.0"}
pushd ${spec_dir}
spec_version=$(git rev-parse --short HEAD)
popd
sed -i.bak -e "s/UNKNOWN SDK VERSION/${sdk_version}/" \
-e "s/UNKNOWN SPEC VERSION/${spec_version}/" ${gen_dir}/sdk.go
rm ${gen_dir}/sdk.go.bak
goimports -l -w ${gen_dir}