Created
March 6, 2017 10:06
-
-
Save kickbase/11a8518106c9219d281db0c9311322ed to your computer and use it in GitHub Desktop.
[Photoshop][Illustrator][JSX] Create intermediate directories.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mkdirp(path) { | |
var fullPath = ""; | |
path = path.toString(); | |
var arr = path.split("/"); | |
for (var i = 0; i < arr.length; i++) { | |
var folderName = arr[i]; | |
fullPath += folderName + "/"; | |
var folder = new Folder(fullPath); | |
if (!folder.exists) folder.create(); | |
} | |
return fullPath; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment