Add version stuff on root
parent
96a5226076
commit
044575d2af
|
@ -41,7 +41,6 @@ var (
|
||||||
allowNew bool
|
allowNew bool
|
||||||
allowPublish bool
|
allowPublish bool
|
||||||
showVer bool
|
showVer bool
|
||||||
version = "master"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -102,15 +101,7 @@ func setupViper() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func printVersion() {
|
func printVersion() {
|
||||||
version = strings.TrimSpace(version)
|
fmt.Println("filemanager version", filemanager.Version)
|
||||||
|
|
||||||
if version == "" {
|
|
||||||
fmt.Println("filemanager is at an untracked version")
|
|
||||||
} else {
|
|
||||||
version = strings.TrimPrefix(version, "v")
|
|
||||||
fmt.Println("filemanager version", version)
|
|
||||||
}
|
|
||||||
|
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,9 @@ import (
|
||||||
"github.com/robfig/cron"
|
"github.com/robfig/cron"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Version is the current File Manager version.
|
||||||
|
const Version = "(untracked version)"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrExist = errors.New("the resource already exists")
|
ErrExist = errors.New("the resource already exists")
|
||||||
ErrNotExist = errors.New("the resource does not exist")
|
ErrNotExist = errors.New("the resource does not exist")
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Releasing version $1"
|
||||||
|
sed -i "s|(untracked version)|$1|g" filemanager.go
|
||||||
|
|
||||||
|
echo "Building assets"
|
||||||
|
./build.sh
|
||||||
|
|
||||||
|
echo "Commiting..."
|
||||||
|
git add -A
|
||||||
|
git commit -m "Version $1"
|
||||||
|
git push
|
||||||
|
|
||||||
|
echo "Creating the tag..."
|
||||||
|
git tag "v$1"
|
||||||
|
git push --tags
|
||||||
|
|
||||||
|
echo "Commiting untracked version notice..."
|
||||||
|
sed -i "s|$1|(untracked version)|g" filemanager.go
|
||||||
|
git add -A
|
||||||
|
git commit -m "untracked version `date`"
|
||||||
|
git push
|
||||||
|
|
||||||
|
echo "Done!"
|
Loading…
Reference in New Issue