-
Notifications
You must be signed in to change notification settings - Fork 437
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
Save files as .js. Treat local .js files as SERVER_JS #27
Conversation
Have you tested pushing two files, named What if someone pulls with the old version of clasp, and now pull with this new version of clasp? Won't they get duplicate files (different extensions)? I think we'll have to break the workflow (users will have to manually rename files), in order to get this right. A potential solution we could implement is renaming all What do you think? |
I'd say, a reasonable thing to do would be to add some functionality that renames all |
How should we handle name collisions if there are files My initial approach of adding if (path.extname(name).toLowerCase() === '.gs') {
// Rename local .gs files to .js
fs.rename(name, `${nameWithoutExt}.js`)
} at line 487 inside |
Let's fail pushing if there is a
There are still lots of Apps Script projects with I think users will have to deal with duplicate files no matter what due to previous versions. |
@jondcallahan, Let me know if you want me to work on the logic of #27 (comment). I'm going to try to update |
@grant Yes, I would appreciate you working on the logic, thanks. I dove in for a bit today but won't have time to pick it back up for a little while. One open question is how to handle the renaming after a user enters |
I like the idea, but some users may want to retain a *.gs centric workflow. Maybe clasp needs to support a configuration mode where users can opt-in or opt-out of this feature. Maybe something like: |
I'm open to PRs that add |
fixes #10
Save
.gs
files with the.js
extension when fetching project files. Assign typeSERVER_JS
to local.js
files when pushing to server.