Skip to content

Commit

Permalink
Issue 660 (#661)
Browse files Browse the repository at this point in the history
* 2.1.0

* Low impact changes (#619)

* dependencies clean-up

* types for child_process' spawnSync

* types for child_process' spawnSync + options fix

* linting

* Relative rootdir (#620)

* relative rootDir support

* relative rootDir support (untrackedFiles behavior changed)

* relative rootDir doc changes

* Cleanup before next pr (#621)

* prettier + sort imports

* splitLines types

* unused package 'connect'

* ucfirst, isOnline types

* ellipsize types

* redundant package 'fs-copy-file-sync'

* removing extra line

* // TODO

* packages dependencies update

* comment fix

* fixes

* nicer ellipsize typing

* better?

* Refactor `inquirer` package (#622)

* regroup `inquirer` into a single file

* fix typo

* linting

* switch to `find-up`

* switch to `find-up` & `strip-bom`

* dependencies update

* findUp implementation fix

* enum accessor fix

* fs-extra & typescript dependency fix

* linting

* dependencies clean-up (again)

* non any cast

* adding `.html` files to default `appsscript.json`

* TODO

* added test for `.html`

* added `.gs`
  • Loading branch information
PopGoesTheWza authored and grant committed Jul 8, 2019
1 parent aecb551 commit e4f7852
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,10 @@ If no `.claspignore` is specified, a default set of patterns is applied. The def
```text
**/**
!appsscript.json
!*.gs
!*.js
!*.ts
!*.html
```

## Project Settings File (`.clasp.json`)
Expand Down
10 changes: 5 additions & 5 deletions src/dotfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
* This should be the only file that uses DOTFILE.
*/

import { Credentials } from 'google-auth-library';
import { OAuth2ClientOptions } from 'google-auth-library/build/src/auth/oauth2client';
import findUp from 'find-up';
import fs from 'fs-extra';
import os from 'os';
import path from 'path';
import findUp from 'find-up';
import fs from 'fs-extra';
import { Credentials } from 'google-auth-library';
import { OAuth2ClientOptions } from 'google-auth-library/build/src/auth/oauth2client';
import stripBom = require('strip-bom');

// Getting ready to switch to `dotf` embedded types
Expand Down Expand Up @@ -106,7 +106,7 @@ export const DOTFILE = {
const buffer = stripBom(fs.readFileSync(DOT.IGNORE.PATH, FS_OPTIONS));
resolve(splitLines(buffer).filter((name: string) => name));
} else {
resolve(['**/**', '!appsscript.json', '!*.js', '!*.ts']);
resolve(['**/**', '!appsscript.json', '!*.gs', '!*.js', '!*.ts', '!*.html']);
}
});
},
Expand Down
12 changes: 7 additions & 5 deletions tests/commands/push.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { CLASP, TEST_CODE_JS } from '../constants';
import { cleanup, setup } from '../functions';
import { describe, it } from 'mocha';

import { spawnSync } from 'child_process';
import { expect } from 'chai';
import fs from 'fs-extra';
import { spawnSync } from 'child_process';
import { describe, it } from 'mocha';
import { CLASP, TEST_CODE_JS, TEST_PAGE_HTML } from '../constants';
import { cleanup, setup } from '../functions';

describe('Test clasp push function', () => {
before(setup);
Expand Down Expand Up @@ -37,10 +36,13 @@ describe('Test clasp push with no `.claspignore`', () => {
before(setup);
it('should push local project correctly', () => {
fs.writeFileSync('Code.js', TEST_CODE_JS);
fs.writeFileSync('page.html', TEST_PAGE_HTML);
const result = spawnSync(
CLASP, ['push'], { encoding: 'utf8', input: 'y' },
);
expect(result.stdout).to.contain('Pushed');
expect(result.stdout).to.contain('Code.js');
expect(result.stdout).to.contain('page.html');
expect(result.stdout).to.contain('files.');
expect(result.status).to.equal(0);
});
Expand Down
5 changes: 3 additions & 2 deletions tests/constants.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { ClaspToken } from '../src/dotfile';
import { OAuth2ClientOptions } from 'google-auth-library';
import os from 'os';
import path from 'path';
import { OAuth2ClientOptions } from 'google-auth-library';
import { ClaspToken } from '../src/dotfile';
import { rndStr } from './functions';

// Sample files
export const TEST_CODE_JS = 'function test() { Logger.log(\'test\'); }';
export const TEST_PAGE_HTML = '<html><body><p>hello there</p></body</html>';

export const TEST_APPSSCRIPT_JSON_WITHOUT_RUN_API = JSON.stringify({
timeZone: 'America/Los_Angeles',
Expand Down

0 comments on commit e4f7852

Please sign in to comment.