【问题标题】:"Executable File" for node.js in GithubGithub 中 node.js 的“可执行文件”
【发布时间】:2015-12-08 01:48:51
【问题描述】:

Github 应该用 "Executable File" 代替 ** lines(** sloc) 在将 shebang #!/usr/bin/env node 放入之后。相反,它会放入线条和 SLOC。我怎样才能说"Executable File"

【问题讨论】:

    标签: node.js github shebang


    【解决方案1】:

    脚本中存在shebang 并不仅仅使文件“可执行”。这只是关于如何执行文件的说明。

    您需要更改文件的模式以允许执行。

    On Linux/Unix:

    chmod +x {file}
    

    On Windows:

    git update-index --chmod=+x {file}
    

    您也可以使用ls-files --stage查看文件的模式:

    # before chmod
    git ls-files --stage
    100644 {commit} {length} {name}
    
    # after chmod
    git ls-files --stage
    100755 {commit} {length} {name}
    

    【讨论】:

      猜你喜欢
      • 2012-12-11
      • 2011-04-25
      • 2019-12-05
      • 1970-01-01
      • 2021-06-19
      • 1970-01-01
      • 1970-01-01
      • 2021-07-28
      • 2022-06-16
      相关资源
      最近更新 更多