move images to archive if stable
This commit is contained in:
parent
b87065b548
commit
72430a2d8e
24
release.go
24
release.go
@ -35,16 +35,24 @@ func release_branch(b string, sDir string, tDir string, dryrun bool, v string) {
|
|||||||
|
|
||||||
if newImages {
|
if newImages {
|
||||||
// delete old firmware files in public folder
|
// delete old firmware files in public folder
|
||||||
for _, file := range check_tDir {
|
// if we are in stable branch, move images to archive
|
||||||
if !(dryrun) {
|
if b == "stable" {
|
||||||
err := os.RemoveAll(tDir + file.Name())
|
err := os.Rename(tDir+"/"+b, tDir+"/archive/v")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("error deleting file: ", err)
|
log.Fatalln(err)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for _, file := range check_tDir {
|
||||||
|
if !(dryrun) {
|
||||||
|
err := os.RemoveAll(tDir + file.Name())
|
||||||
|
if err != nil {
|
||||||
|
log.Println("error deleting file: ", err)
|
||||||
|
} else {
|
||||||
|
log.Println("removed file: ", file.Name())
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log.Println("removed file: ", file.Name())
|
log.Println("DRYRUN: delete folder :", file.Name())
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
log.Println("DRYRUN: delete folder :", file.Name())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user