wait for it
This commit is contained in:
parent
f1142986e9
commit
6488f3d77c
@ -25,7 +25,7 @@ func main() {
|
|||||||
sourceMap := make(map[string]string)
|
sourceMap := make(map[string]string)
|
||||||
fileInfos, dirErr := ioutil.ReadDir("./")
|
fileInfos, dirErr := ioutil.ReadDir("./")
|
||||||
if dirErr != nil { panic(dirErr) }
|
if dirErr != nil { panic(dirErr) }
|
||||||
baseTrimmer, _ := regexp.Compile("([0-9x]+-)|(.go)")
|
baseTrimmer, _ := regexp.Compile("[0-9x]+-")
|
||||||
for _, fi := range fileInfos {
|
for _, fi := range fileInfos {
|
||||||
baseName := baseTrimmer.ReplaceAllString(fi.Name(), "")
|
baseName := baseTrimmer.ReplaceAllString(fi.Name(), "")
|
||||||
if baseName != ".git" && baseName != "tool" && baseName != "README.md" {
|
if baseName != ".git" && baseName != "tool" && baseName != "README.md" {
|
||||||
@ -52,7 +52,7 @@ func main() {
|
|||||||
// rename some stuff
|
// rename some stuff
|
||||||
for index, indexName := range indexNames {
|
for index, indexName := range indexNames {
|
||||||
oldName := sourceMap[indexName]
|
oldName := sourceMap[indexName]
|
||||||
newName := fmt.Sprintf("%03d-%s.go", index+1, indexName)
|
newName := fmt.Sprintf("%03d-%s", index+1, indexName)
|
||||||
if oldName != newName {
|
if oldName != newName {
|
||||||
os.Rename(oldName, newName)
|
os.Rename(oldName, newName)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user