blob: 54299e55ea5c69b4b3da27d9c6712bd223d14008 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/* Javascript for OpenPCR
*
* http://openpcr.org
* Copyright (c) 2011 OpenPCR
*/
/* Checks if the OpenPCR app is booted up for the first time. If so, a sample set of "Experiments" is created for the user */
// check if the "Experiments" folder exists in the user's storage
// if the Experiments folder exists, don't do anything
// if the "Experiments" folder doesn't exist, copy the "Experiments" folder from the app directory into the user's application storage dir
// files from the app folder
source = air.File.applicationDirectory.resolvePath("Default Experiments");
// into the user's storage folder
destination = air.File.applicationStorageDirectory.resolvePath("Experiments");
// copy
source.copyTo( destination, false ); // should throw an error to IO, "Error: Error #3012: Cannot delete file or directory" if folder exists
|