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

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

Open
nyoma-diamond opened this issue Mar 7, 2018 · 22 comments
Labels
Milestone

Comments

@nyoma-diamond
Copy link

nyoma-diamond commented Mar 7, 2018

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
Copy link
Contributor

Seeing the same behavior.

@amerrnath-murugan-E0711
Copy link

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

@kferrone
Copy link

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

@grant grant added this to the Clasp V2 milestone Oct 29, 2018
@takanakahiko
Copy link
Contributor

takanakahiko commented Nov 5, 2018

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
Copy link
Contributor

grant commented Nov 5, 2018

@takanakahiko Sounds good! PRs welcome.

@takanakahiko takanakahiko mentioned this issue Nov 9, 2018
3 tasks
@grant grant closed this as completed in #383 Nov 9, 2018
@fahadnaeem
Copy link

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

@grant grant reopened this Feb 17, 2019
@grant
Copy link
Contributor

grant commented Mar 28, 2019

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

@PopGoesTheWza
Copy link
Collaborator

PR #620 should fix this

@PopGoesTheWza
Copy link
Collaborator

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

@armand1m
Copy link

armand1m commented Feb 8, 2020

the error still happens in clasp 2.3.0

@PopGoesTheWza
Copy link
Collaborator

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

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

@ghost
Copy link

ghost commented Jun 26, 2020

image

@PopGoesTheWza
Copy link
Collaborator

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

@ghost
Copy link

ghost commented Jun 27, 2020

@PopGoesTheWza
image

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

.gitignore
image

@PopGoesTheWza
Copy link
Collaborator

@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
Copy link

ghost commented Jun 27, 2020

w00t :D/

@PopGoesTheWza
Copy link
Collaborator

@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
Copy link

jackhartnett commented Nov 11, 2020

@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
Copy link
Collaborator

@jackhartnett Please clarify the status on this issue

@Yash-Singh1
Copy link

Issue still persists on clasp 2.4.1.

@koconnor3
Copy link

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

@chardskarth
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests