You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: import_export_development/README.md
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -7,18 +7,19 @@ This sample uses the community project [node-google-apps-script](https://www.npm
7
7
1. run `npm install -g node-google-apps-script` to install it globally. This will allow you to run a few of the steps below from the command line.
8
8
2. Go through the [configuration and authorization steps](https://www.npmjs.com/package/node-google-apps-script).
9
9
2. Run `npm install -g gulp` if you do not already have the [gulp](http://gulpjs.com/) task runner installed globally.
10
-
3. Clone this repository, `cd google-apps-script-samples\import_export_development`, and run `npm install`. This will set up all of the local dependencies for the project.
10
+
3. Clone this repository, `cd google-apps-script-samples/import_export_development`, and run `npm install`. This will set up all of the local dependencies for the project.
11
11
12
12
### Demonstrating the developer flow
13
13
To get the initial setup working for you, perform the following steps. In a real project, each developer would perform these steps, so that they can do development in isolation from other developers:
14
14
15
15
1. Create a [new Google Spreadsheet](https://docs.google.com/spreadsheets/create), and copy the ID of the file. The file ID is found in the URL to the spreadsheet:
2. Open the file *src\environments\dev\debug.local.config.js*, and replace DRIVE_FILE_ID with the ID that you copied.
17
+
2. Open the file *src/environments/dev/debug.local.config.js*, and replace DRIVE_FILE_ID with the ID that you copied.
18
18
3. Create a new standalone [Google Apps Script](https://script.google.com) project, and copy the ID of the script. The file ID is found in the URL to the script project:
@@ -35,7 +36,7 @@ You can run the code either by publishing it as a web app, or testing it as an a
35
36
This second phase mimics the setup to isolate testing from development. This would typically be a single Apps Script file for the project, and would have some different code added to enable testing scenarios. In a real project, a testing coordinator or other similar role would perform these steps:
36
37
37
38
1. Create a [new Google Spreadsheet](https://docs.google.com/spreadsheets/create), and copy the ID of the file. Add 4 additional sheets to the file (the test looks for 5 sheets).
38
-
2. Open the file *src\environments\tst\a.myproj.tst.config.js*, and replace DRIVE_FILE_ID with the ID that you copied.
39
+
2. Open the file *src/environments/tst/a.myproj.tst.config.js*, and replace DRIVE_FILE_ID with the ID that you copied.
39
40
3. Perform the same steps #3 and #4 from above, replacing `dev` with `tst`.
40
41
4. Refresh the Apps Script project, open the file `a.myproj.tests.server.main.js`, and then run the function `runAllTests`. Once the run completes, open the log view to see the output.
41
42
@@ -47,7 +48,7 @@ This final phase mimics the setup to prepare for a production deployment. This w
47
48
48
49
49
50
1. Perform the same steps #3 and #4 from above, replacing `dev` with `prd`.
50
-
2. Refresh the Apps Script project, open the script properties, and click on the "Scopes" tab. You will see that the spreadsheet scope now only allows the current attached doc, which is what we would want for production.
51
+
2. Refresh the Apps Script project, open the project properties (File --> Project properties), and click on the "Scopes" tab. You will see that the spreadsheet scope now only allows the current attached doc (`spreadsheets.currentonly`), which is what we would want for production.
51
52
3. You can also create a new spreadsheet, set up for add-on testing, and the code will run successfully.
52
53
53
54
For production, the configuration file does *not* have a specific spreadsheet, and has the annotation @onlycurrent doc. That will ensure that only Spreadsheets that the code has been linked via the Add-on can be accessed. This limiting of scope is a good practice to provide more confidence to your users that you are only working on sheets that they have linked to your add-on.
0 commit comments