Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using anything other than gs, js, or ts for fileExtension results in script file not being pushed #884

Open
imthenachoman opened this issue Oct 27, 2021 · 2 comments

Comments

@imthenachoman
Copy link

Expected Behavior

If you set fileExtension to something other than gs, js, or ts it should work with both pulling and pushing.

It does work with pulling but not with pushing.

I think it is because of this code:

const defaultClaspignore = `# ignore all files…
**/**

# except the extensions…
!appsscript.json
!**/*.gs
!**/*.js
!**/*.ts
!**/*.html

# ignore even valid files if in…
.git/**
node_modules/**
`;

and

// Methods for retrieving dotfiles.
export const DOTFILE = {
  /**
   * Reads ignore.resolve() to get a glob pattern of ignored paths.
   * @return {Promise<string[]>} A list of file glob patterns
   */
  IGNORE: async () => {
    const ignorePath = config.ignore;
    const content =
      ignorePath && fs.existsSync(ignorePath) ? fs.readFileSync(ignorePath, FS_OPTIONS) : defaultClaspignore;

    return splitLines(stripBom(content)).filter((name: string) => name.length > 0);
  }

Because the default ignore does not include the custom fileExtension option. I know you could fix this by using your own ignore file but I'm thinking the defaultClaspignore should read the config file. No?

@imthenachoman
Copy link
Author

For what it is worth, I am working on a fix.

imthenachoman added a commit to imthenachoman/clasp that referenced this issue Oct 27, 2021
- Fixed issues with `fileExtension` (see google#884)
- Added `htmlExtension` for a custom HTML file extension (see google#703)
@imthenachoman
Copy link
Author

I think I fixed this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant