Comments (9)
Sort of, but not just the project ID. Suppose the same technique could be used with renaming .claspignore and manifest files, but it's clunky. Better would be to just take the file patterns as optional arguments. If they're present, push those files. If not, fall back on the current algorithm.
Ideally we'd have both an environment option for auth/project ID and a way to easily change file sets. I'd like my package.json to look something like:
"scripts": {
"push-test": "clasp push --env=test appsscript.test.json test/**.js src/**.js"
"push-prod": "clasp push --env=prod appscript.prod.json src/**.js",
...
}
from clasp.
Do you mean test/prod options like #12?
from clasp.
I don't see a use-case where a 1-line bash script can't solve. I'd rather have the CLI be minimal and use git
's features or a bash file instead.
from clasp.
A few reasons:
- It's not a 1 line script. Also need to make sure the ephemeral files are ignored by git or whatever source control system is being used.
- Sometimes expressing things in the affirmative is easier than expressing them in the negative. Right now clasp only allows expressing things negatively -- tell me the files you don't want to push. In more complex projects, the affirmative expression can end up being more concise.
- Taking args via CLI accommodates different build systems. Some build systems (e.g. bazel) don't put generated/intermediate files under the project directory, but rather in a separate parallel tree to avoid polluting the source dir. Clasp should be accommodating here.
I'm certainly open to other ways of solving the problem. But in general, it's pretty common that any CLI tools that operate on files allow passing the paths via arguments. That part shouldn't be controversial.
from clasp.
Questions (Can you modify the first comment with the details about this FR to reduce discussion?):
- Can you point to some similar flags/samples in other CLIs?
- Can you have a more concrete example? I don't really understand the use-case and why you need this feature.
- Can we modify how
.claspignore
works to accommodate explicitly kept files? - Why can't you just do this:
mv .claspignore-prod .claspignore && mv .appsscript-prod.json .appsscript.json
mv .claspignore-test .claspignore && mv .appsscript-test.json .appsscript.json
from clasp.
Updated the original comment w/examples of other CLIs that behave this way as well as the use case later mentioned in the discussion.
from clasp.
There is similar CLI as clasp. it is gas-manager.
gas-manager has options to specify environment(project ID), credential, etc...
Please see https://github.com/soundTricker/gas-manager#cli
from clasp.
I'll look at PR proposals that use npm's config for environments in package.json
.
{
"config": {
"env": {
"prod": ...
"test": ...
}
}
}
from clasp.
I don't see a future where I can support this feature.
Hopefully a wrapper bash script can solve the issue at hand.
Closing this issue, but feel free to comment here as it can be re-opened at a later date.
from clasp.
Related Issues (20)
- "No access, refresh token, API key or refresh handler callback is set." error on login HOT 2
- Clasp fails at CASA Tier 2 scan due to a vulnerability in cacheable-request at version 7.0.2 HOT 1
- Unable to use `clasp run` in Github actions workflow
- [FR] please provide option to specify port for clasp login
- Facing issue when tried to do clasp login with service account HOT 1
- Does clasp support Typescript 4.2? The latest version of ts2gas supports Typescript 4.2
- Feature request : set / get the GCP Project of the Script HOT 3
- .claspignore is not ignoring anything in it HOT 3
- 'clasp login' doesn't wait for response
- Access blocked: authorisation error when running clasp login
- Clasp claims it has pushed files even when Apps Script API is not enabled
- Clasp project dead ? HOT 3
- IMPORTANT: Clasp login may fail for new users HOT 2
- Clasp pull does not empty the local project folder before pulling
- Console log - incorrect time zone
- clasp push hangs if .claspignore file is present HOT 1
- A silent failure occurs if a file path listed in `filePushOrder` does not exist HOT 2
- TypeError: Missing internal module 'internal/deps/node:stream' HOT 2
- Tests are broken (access denied to "communal testing project")
- [RFC] Multiple (private) GAS targets: remotes HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clasp.