fixrbc

Tool to rename RBC statements to yyyy-mm-dd format
git clone https://git.bracken.jp/fixrbc.git
Log | Files | Refs | LICENSE

main.go (420B)


      1 package main
      2 
      3 import (
      4 	"io/ioutil"
      5 	"log"
      6 	"os"
      7 
      8 	"git.bracken.jp/fixstmt/convert"
      9 )
     10 
     11 func main() {
     12 	files, err := ioutil.ReadDir("./")
     13 	if err != nil {
     14 		log.Fatal(err)
     15 	}
     16 	for _, f := range files {
     17 		converter, err := convert.ConverterForFile(f.Name())
     18 		if err != nil {
     19 			log.Fatal(err)
     20 		}
     21 		newFname, err := converter.Convert(f.Name())
     22 		if err != nil {
     23 			log.Fatal(err)
     24 		}
     25 		os.Rename(f.Name(), newFname)
     26 	}
     27 }