google / clasp

🔗 Command Line Apps Script Projects
https://developers.google.com/apps-script/guides/clasp
Apache License 2.0
4.57k stars 427 forks source link

No way to ignore a specific file within a specifically added directory in .claspignore #58

Open nyoma-diamond opened 6 years ago

nyoma-diamond commented 6 years ago

Expected Behavior

If .claspignore contains **/** !**/gs/** gs/genericFile.js

clasp should ignore everything that isn't in /gs and ignore genericFile.js

Actual Behavior

Clasp still pushes genericFile.js; pushes contents of /gs

nmccready commented 6 years ago

Seeing the same behavior.

amerrnath-murugan-E0711 commented 6 years ago

Any updates on this bug, i am still seeing the bug in version 1.5.3

kferrone commented 5 years ago

I definitely can't ignore the node_modules folder either???

takanakahiko commented 5 years ago

I propose to use multimatch. This can get results like gitignore.

var anymatch = require('anymatch');
var micromatch = require('micromatch');
var multimatch = require('multimatch');

anymatch(['**/**', '!**/gs/**', 'gs/genericFile.js'], 'hoge.js')
// true
anymatch(['**/**', '!**/gs/**', 'gs/genericFile.js'], 'gs/genericFile.js')
// false
anymatch(['**/**', '!**/gs/**', 'gs/genericFile.js'], 'gs/hoge.js')
// false

micromatch(['hoge.js','gs/genericFile.js','gs/hoge.js'], ['**/**', '!**/gs/**', 'gs/genericFile.js'])
// [ 'hoge.js' ] <- bad

multimatch(['hoge.js','gs/genericFile.js','gs/hoge.js'], ['**/**', '!**/gs/**', 'gs/genericFile.js'])
// [ 'hoge.js', 'gs/genericFile.js' ]

EDIT :

anymatch & micromatch : Priority of Negation patterns > Priority of not Negation patterns multimatch : Priority of Previous patterns < Priority of following patterns

grant commented 5 years ago

@takanakahiko Sounds good! PRs welcome.

fahadnaeem commented 5 years ago

I want to ignore gulpfile.js using .claspignore but I'm unable to do. I'm using clasp@3

grant commented 5 years ago

clasp@3 isn't out, but I assume there are still issues with this?

PopGoesTheWza commented 5 years ago

PR #620 should fix this

PopGoesTheWza commented 5 years ago

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

armand1m commented 4 years ago

the error still happens in clasp 2.3.0

PopGoesTheWza commented 4 years ago

@armand1m Could you please provide some context about your issue?

Do you have a sample .claspignore to reproduce the issue?

ghost commented 4 years ago

image

PopGoesTheWza commented 4 years ago

@grimmigenaai not sure if your issue is related to Microsoft Windows. What is the output of clasp status

ghost commented 4 years ago

@PopGoesTheWza image

so, here is the answer: clasp picks up the .gitignore :) .claspignore image

.gitignore image

PopGoesTheWza commented 4 years ago

@grimmigenaai Fact is... .claspignore is correctly detected and parsed. But the file matching that follow is broken.

I can trace down the change which introduced the problem to about a year ago (and I am to blame for that change)

I'll try to fix it in the coming week as I refactor this part of the code.

ghost commented 4 years ago

w00t \:D/

PopGoesTheWza commented 4 years ago

@grimmigenaai (and others) can you test with the #791 unofficial release?

npm uninstall -g @google/clasp && npm install -g forked-clasp
clasp --version
# should be 2.4.0 or more
jackhartnett commented 3 years ago

@PopGoesTheWza

I am still experiencing this issue on version 2.4.0.

I'm using a sample .claspignore file from the documentation. This has been an extremely frustrating morning to say the least.

Edit (again): I reverted back from 2.4.0 to 2.3.0 and I have gotten "clasp push" working again. Every one of my files was being flagged as ignored despite the contents of .claspignore

PopGoesTheWza commented 3 years ago

@jackhartnett Please clarify the status on this issue

Yash-Singh1 commented 2 years ago

Issue still persists on clasp 2.4.1.

koconnor3 commented 1 year ago

I am also still seeing this issue on 2.4.1 (cannot .claspignore node_modules, which is extremely annoying)

chardskarth commented 1 year ago

Should this be closed? I'm not able to replicate in 2.4.2