Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the version of linebot/version.go and add a shell script to prevent to forget update of linebot/version.go . #103

Merged
merged 4 commits into from
Aug 29, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ sudo: false

install:
- go get golang.org/x/lint/golint
- go get github.com/haya14busa/reviewdog/cmd/reviewdog
- curl -L -o $HOME/bin/reviewdog https://github.com/haya14busa/reviewdog/releases/download/0.9.11/reviewdog_linux_amd64
- chmod a+x $HOME/bin/reviewdog

script:
- reviewdog -reporter=github-pr-check
Expand Down
2 changes: 1 addition & 1 deletion linebot/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

package linebot

const version = "1.0.0"
const version = "3.0.0"
56 changes: 56 additions & 0 deletions script/tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Update and commit linebot/version.go and create a new tag.
#
# Usage:
# bash script/tag.sh v3.0.0

if [ $# -gt 1 ]; then
echo "too many arguments" > /dev/stderr
echo 'Usage: tag.sh $TAG' > /dev/stderr
exit 1
fi

if [ $# -lt 1 ]; then
echo "TAG argument is required" > /dev/stderr
echo 'Usage: tag.sh $TAG' > /dev/stderr
exit 1
fi

TAG=$1
echo "TAG: $TAG"
VERSION=${TAG#v}

if [ "$TAG" = "$VERSION" ]; then
echo "TAG must start with 'v'"
exit 1
fi

echo "cd `dirname $0`/.."
cd `dirname $0`/..

echo "create linebot/version.go"
cat << EOS > linebot/version.go
// Copyright 2016 LINE Corporation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2018?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry..

Copy link
Contributor Author

@suzuki-shunsuke suzuki-shunsuke Aug 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I misunderstood.
This 2016 is correct. linebot/version.go has created before 2018.
I should add LICENSE at the head of tag.sh.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the license.
87cba7b

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I was wrong, thank you 🙇

//
// LINE Corporation licenses this file to you under the Apache License,
// version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
//
// Don't edit this file directly. This file is generated by script/tag.sh .

package linebot

const version = "$VERSION"
EOS

git add linebot/version.go
git commit -m "Update version to $TAG"
echo "git tag $TAG"
git tag $TAG