@@ -50,15 +50,28 @@ version = "1.0.0"
5050// Depending on your OS, the code below should set the correct location, if you are using a Mac,
5151// Windows, or Linux machine.
5252// If you run the Gradle task deployToProcessingSketchbook, and you do not see your library
53- // in the contributions manager , then one possible cause could be the sketchbook location
53+ // listed as a contributed library , then one possible cause could be the sketchbook location
5454// is wrong. You can check the sketchbook location in your Processing application preferences.
5555var sketchbookLocation = " "
5656val userHome = System .getProperty(" user.home" )
5757val currentOS = OperatingSystem .current()
5858if (currentOS.isMacOsX) {
59- sketchbookLocation = " $userHome /Documents/Processing/sketchbook"
59+ sketchbookLocation = if (File (" $userHome /Documents/Processing/sketchbook" ).isDirectory) {
60+ " $userHome /Documents/Processing/sketchbook"
61+ } else {
62+ " $userHome /Documents/Processing"
63+ }
6064} else if (currentOS.isWindows) {
61- sketchbookLocation = " $userHome /My Documents/Processing/sketchbook"
65+ val docsFolder = if (File (" $userHome /My Documents" ).isDirectory) {
66+ " $userHome /My Documents"
67+ } else {
68+ " $userHome /Documents"
69+ }
70+ sketchbookLocation = if (File (docsFolder," Processing/sketchbook" ).isDirectory) {
71+ " $docsFolder /Processing/sketchbook"
72+ } else {
73+ " $docsFolder /Processing"
74+ }
6275} else {
6376 sketchbookLocation = " $userHome /sketchbook"
6477}
0 commit comments