Skip to content

Commit

Permalink
UPDATE filetype check logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jonghyeons committed Mar 8, 2019
1 parent 39ba0c5 commit 2283f86
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ import (

func main() {
flag.Parse()
// fmt.Println("option:", flag.Args())
dir, _ := filepath.Abs(filepath.Dir(os.Args[0]))
if len(flag.Args()) != 0 && flag.Args()[0] == "true" {
// $ photopic true
///////////////////////////////////
// TODO :: 날짜별 분류
///////////////////////////////////

} else {
// $ photopic
makeDir()
Expand All @@ -26,9 +24,11 @@ func main() {
return
}
for _, file := range files {
if strings.Contains(file.Name(), "JPG") {
fn := strings.Split(file.Name(), ".")
fileType := fn[len(fn)-1]
if fileType == "JPG" {
os.Rename(file.Name(), "./jpg/"+file.Name())
} else if strings.Contains(file.Name(), "RAF") {
} else if fileType == "RAF" || fileType == "CR2" {
os.Rename(file.Name(), "./raw/"+file.Name())
}
}
Expand Down

0 comments on commit 2283f86

Please sign in to comment.