Skip to content

Instantly share code, notes, and snippets.

@kickbase
Created March 6, 2017 10:06
Show Gist options
  • Save kickbase/11a8518106c9219d281db0c9311322ed to your computer and use it in GitHub Desktop.
Save kickbase/11a8518106c9219d281db0c9311322ed to your computer and use it in GitHub Desktop.
[Photoshop][Illustrator][JSX] Create intermediate directories.
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