Giter Club home page Giter Club logo

Comments (19)

qin-nz avatar qin-nz commented on September 21, 2024

这个 bug 还是高优处理下吧,
这个会在一些文件夹里出现,但因为不懂 js,所以不太能帮助定位

from linec.

hua1995116 avatar hua1995116 commented on September 21, 2024

OK,我处理一下

from linec.

hua1995116 avatar hua1995116 commented on September 21, 2024

npm i -g [email protected] 试试

from linec.

qin-nz avatar qin-nz commented on September 21, 2024

1.3.7 不报错了,但是结果没东西

T=0.024 s (0.0 files/s 0.0 lines/s)
--------------------------------------------------
language            files     blank      code

SUM                     0         0         0
--------------------------------------------------

from linec.

qin-nz avatar qin-nz commented on September 21, 2024

我的是 Windows 系统
在文件夹 xxx 这个路径下运行是无结果的,我尝试把当前文件夹的名称从 xxx 改成了 xxx-1 就能正常看到输出了。

from linec.

hua1995116 avatar hua1995116 commented on September 21, 2024

你的文件名有什么特殊的吗

from linec.

qin-nz avatar qin-nz commented on September 21, 2024

@hua1995116 没有,除了盘符 C:,只有英文字母和分隔符,Windows 上是 \

from linec.

hua1995116 avatar hua1995116 commented on September 21, 2024

我用 windows 试试

from linec.

hua1995116 avatar hua1995116 commented on September 21, 2024

@qin-nz 你方便加个联系方式么,需要你的帮助调试。因为我本地测试是ok的

from linec.

qin-nz avatar qin-nz commented on September 21, 2024

我用console.log调试了你的代码,找到问题了,是 .gitignore 的问题。具体如下:

背景:Go 语言用 go build 生成的可执行文件默认是和当前文件夹同名的,为了避免二进制被提交,需要在 .gitignore 中排除这个文件。

我看你的代码尝试解析了 .gitignore,然后把和文件夹同名的那个文件名列入了忽略列表。
这就带来了潜在问题,如果你在 mac/linux 上在 .gitignore 中写个 home 或者 Windows 中 写个 Users,那么整个目录都会被忽略。

建议:把 cPath 改成基于当前目录(更准确些是 --path 指定路径)的相对路径格式(当然,因为改成了相对路径,不确定其他地方是否需要一同修改) ig.ignores(cPath);

from linec.

hua1995116 avatar hua1995116 commented on September 21, 2024

@qin-nz 我有点迷惑,在 .gitignore 写个 home ,那么当前的 home 被忽略应该是正常的吧? 等不能提供下你的代码目录树。。我看下到底是为啥

from linec.

qin-nz avatar qin-nz commented on September 21, 2024

@qin-nz

在 .gitignore 写个 home ,那么当前的 home 被忽略应该是正常的吧?

是的,正常,但它实际上会把 /home 都忽略了,而不仅仅是当前目录下的 home

from linec.

qin-nz avatar qin-nz commented on September 21, 2024

我的场景是在
C:\Users\qin-nz\xxx\.gitignore 内容包含 xxx,希望忽略的是 C:\Users\qin-nz\xxx\xxx,但实际上 C:\Users\qin-nz\xxx 这整个目录(也就是我运行 linec 的目录)都被忽略了。

from linec.

hua1995116 avatar hua1995116 commented on September 21, 2024

奥。这个意思,我测试一下, 也就是 .gitignore 作用范围被扩大了。

from linec.

qin-nz avatar qin-nz commented on September 21, 2024

是的,至少在Windows上如此。

from linec.

hua1995116 avatar hua1995116 commented on September 21, 2024

@qin-nz npm i linec@latest -g 升级到最新版,这个问题解决了,唔,抱歉,最近有点忙,这么久了才修复。

from linec.

qin-nz avatar qin-nz commented on September 21, 2024

我感觉你改完之后,好像 .gitignore 完全失效了

from linec.

hua1995116 avatar hua1995116 commented on September 21, 2024

是的,有个变量写错了,源码运行是正常的,打包完用了严格模式,导致出错了。 测试用例还是很重啊 - - ,后面得补一补,太折腾了。 升级了 1.3.11

from linec.

qin-nz avatar qin-nz commented on September 21, 2024

@hua1995116 非常感谢,现在可用啦

from linec.

Related Issues (4)

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.