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

File push order seems to be broken #624

Open
DimuDesigns opened this issue May 21, 2019 · 12 comments
Open

File push order seems to be broken #624

DimuDesigns opened this issue May 21, 2019 · 12 comments

Comments

@DimuDesigns
Copy link

DimuDesigns commented May 21, 2019

Expected Behavior

clasp push adheres to file push order defined in .clasp.json.

Actual Behavior

clasp push results in project files listed in lexicographic order.

Steps to Reproduce the Problem

  1. Pull contents of a GAS project via clasp pull
  2. Edit the generated .clasp.json file with the desired push order.
  3. Create a new GAS project for testing (to protect the original GAS project from order wrangling).
  4. Update .clasp.json with script id from new project.
  5. Push project via clasp push.
  6. Open/refresh dupe(formerly blank) GAS project.

Specifications

  • Node version 10.15.0:
  • Version 2.1.0:
  • OS (Mac/Linux/Windows):

Added Context

This is what my project looks like pre-push:

projectFileOrder

Here's a snippet of the filePushOrder taken from my .clasp.json file:

filePushOrderFromClaspJSON

BUT... here's what my project looks like post clasp push:

projectPostClaspPush

@DimuDesigns
Copy link
Author

Decided to try clasp again in order to test out the filePushOrder feature. Doesn't seem to work as advertised.

@DimuDesigns DimuDesigns changed the title File push order seems to be broken... File push order seems to be broken...for a specific edge case. May 21, 2019
@DimuDesigns DimuDesigns changed the title File push order seems to be broken...for a specific edge case. File push order seems to be broken May 21, 2019
@PopGoesTheWza
Copy link
Collaborator

@DimuDesigns are you using the latest npm release or building directly from this repository?

@DimuDesigns
Copy link
Author

@PopGoesTheWza Latest NPM release.

@PopGoesTheWza
Copy link
Collaborator

PopGoesTheWza commented May 22, 2019

A PR fixing this has been merged, so you can either wait until next release or build your own from this repository

clone this repository locally and run npm uninstall -g @google/clasp && npm run build-fresh

@PopGoesTheWza
Copy link
Collaborator

@DimuDesigns can you try with clasp 2.2.0 if the issue still occurs?

@kornthing
Copy link

I'm using clasp 2.3.0 and I don't think that this issue has been fixed already. I've made an example on StackOverflow.
I've listed here all opened issues concerned this problem on Git google/clasp:

@PopGoesTheWza
Copy link
Collaborator

@DimuDesigns @kornthing Using the latest npm version of @google/clasp I do not experience any issue related to the filePushOrder in .clasp.json

If you still are, please share a github repository with some sample code and .clasp.json(no need to give access to your Google Apps Script project) so that I may investigate further.

@PopGoesTheWza
Copy link
Collaborator

Here is a sample repository I used to check proper usage of filePushOrder.

A better description in the doc may be useful though and a PR would be appreciated.

@PopGoesTheWza
Copy link
Collaborator

PopGoesTheWza commented Feb 22, 2020

@kornthing can you please give a status about this issue?

@Spencer-Easton
Copy link

If anyone is still having issues with this you need to remember to add the path to the file including the rootDir.
For example a build folder such as:
build-
server-
- file1.js
-file2.js

Would need to add 'build/server/' to the file name.
{
"scriptId":"123456789",
"rootDir":"build",
"filePushOrder": ["build/server/file2.js", "build/server/file1.js"]
}

@jpgklassen
Copy link

Strangely enough, removing the rootDir value from .clasp.json solved this for me.

@felimartina
Copy link

Wow, removing rootDir fixed the issue. Thanks @jpgklassen

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

6 participants