diff options
| author | realtradam <[email protected]> | 2020-04-26 01:58:36 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-04-26 01:58:36 -0400 |
| commit | 236fd0f414ffc4d17dd392b584ef4826b4935d51 (patch) | |
| tree | 8b483ab72ac7ce1be6ac31cdeb8987a8390bccc3 | |
| parent | c155f70cf3bdad39b4b6788f455cb5ead992d81f (diff) | |
| download | musicSorter-236fd0f414ffc4d17dd392b584ef4826b4935d51.tar.gz musicSorter-236fd0f414ffc4d17dd392b584ef4826b4935d51.zip | |
Fixed valid directory check
| -rw-r--r-- | musicSorter.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/musicSorter.rb b/musicSorter.rb index 30c4f75..7b9a9dc 100644 --- a/musicSorter.rb +++ b/musicSorter.rb @@ -10,8 +10,13 @@ errors = Array.new illegalCharacter = Array['/', '?', '\\', ':', '*', '"', '<', '>', '|'] songsDirectory = ARGV[0]#Where you want your organized songs to end up +if songsDirectory == nil + puts "Invalid Directory Given" + exit(1) +end if !Dir.exist?(songsDirectory) puts "Invalid Directory Given" + exit(1) end #All extensions you want considered and moved @@ -99,3 +104,4 @@ end for error in errors puts error end + |
