clasp icon indicating copy to clipboard operation
clasp copied to clipboard

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

Open nyoma-diamond opened this issue 7 years ago • 22 comments
trafficstars

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

nyoma-diamond avatar Mar 07 '18 07:03 nyoma-diamond

Seeing the same behavior.

nmccready avatar Mar 13 '18 16:03 nmccready

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

amerrnath-murugan-E0711 avatar Sep 04 '18 13:09 amerrnath-murugan-E0711

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

kferrone avatar Oct 23 '18 00:10 kferrone

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

takanakahiko avatar Nov 05 '18 15:11 takanakahiko

@takanakahiko Sounds good! PRs welcome.

grant avatar Nov 05 '18 16:11 grant

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

fahadnaeem avatar Feb 17 '19 09:02 fahadnaeem

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

grant avatar Mar 28 '19 04:03 grant

PR #620 should fix this

PopGoesTheWza avatar May 18 '19 15:05 PopGoesTheWza

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

PopGoesTheWza avatar Jul 03 '19 20:07 PopGoesTheWza

the error still happens in clasp 2.3.0

armand1m avatar Feb 08 '20 16:02 armand1m

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

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

PopGoesTheWza avatar Feb 14 '20 03:02 PopGoesTheWza

image

ghost avatar Jun 26 '20 00:06 ghost

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

PopGoesTheWza avatar Jun 26 '20 20:06 PopGoesTheWza

@PopGoesTheWza image

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

.gitignore image

ghost avatar Jun 27 '20 02:06 ghost

@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.

PopGoesTheWza avatar Jun 27 '20 06:06 PopGoesTheWza

w00t :D/

ghost avatar Jun 27 '20 06:06 ghost

@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

PopGoesTheWza avatar Jul 15 '20 19:07 PopGoesTheWza

@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

jackhartnett avatar Nov 11 '20 18:11 jackhartnett

@jackhartnett Please clarify the status on this issue

PopGoesTheWza avatar Dec 14 '20 19:12 PopGoesTheWza

Issue still persists on clasp 2.4.1.

Yash-Singh1 avatar Jun 25 '22 19:06 Yash-Singh1

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

koconnor3 avatar Oct 21 '22 19:10 koconnor3

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

chardskarth avatar Apr 16 '23 01:04 chardskarth