Giter VIP home page Giter VIP logo

Comments (9)

sqrrrl avatar sqrrrl commented on June 3, 2024 3

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.

grant avatar grant commented on June 3, 2024

Do you mean test/prod options like #12?

from clasp.

grant avatar grant commented on June 3, 2024

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.

sqrrrl avatar sqrrrl commented on June 3, 2024

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.

grant avatar grant commented on June 3, 2024

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.

sqrrrl avatar sqrrrl commented on June 3, 2024

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.

fossamagna avatar fossamagna commented on June 3, 2024

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.

grant avatar grant commented on June 3, 2024

I'll look at PR proposals that use npm's config for environments in package.json.

{
  "config": {
    "env":  {
      "prod": ...
      "test": ...
    }
  }
}

from clasp.

grant avatar grant commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.