Skip to content

Commit ece8f70

Browse files
committed
Add -v flag to get current version. Closes #8
1 parent 06150f3 commit ece8f70

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ import (
2323
"github.com/aws/aws-sdk-go/service/s3/s3manager"
2424
)
2525

26+
// VERSION is the current version
27+
const VERSION = "0.1.0"
28+
2629
var defaultS3Bucket = "static.buffer.com"
2730
var uploader *s3manager.Uploader
2831
var svc *s3.S3
@@ -191,8 +194,14 @@ func main() {
191194
directory := flag.String("dir", "", "required, the directory to upload files to in the bucket")
192195
filesArg := flag.String("files", "", "the path to the files you'd like to upload, ex. \"public/**/.*js,public/style.css\"")
193196
outputFilename := flag.String("o", "staticAssets.json", "the json file you'd like your generate")
197+
printVersion := flag.Bool("v", false, "print the current buffer-static-upload version")
194198
flag.Parse()
195199

200+
if *printVersion {
201+
fmt.Printf("%s\n", VERSION)
202+
os.Exit(0)
203+
}
204+
196205
if *directory == "" && *s3Bucket == defaultS3Bucket {
197206
fatal("To use the default bucket you need to specify an upload directory (-dir)")
198207
}

0 commit comments

Comments
 (0)