我正在Mac上制作NW.js应用程序,并希望通过双击图标以开发模式运行应用程序.第一步,我正在尝试使我的shell脚本工作.
在Windows上使用VSCode(我想获得时间),我run-nw在项目的根目录创建了一个文件,其中包含:
#!/bin/bash
cd "src"
npm install
cd ..
./tools/nwjs-sdk-v0.17.3-osx-x64/nwjs.app/Contents/MacOS/nwjs "src" &
Run Code Online (Sandbox Code Playgroud)
但我得到这个输出:
$ sh ./run-nw
: command not found
: No such file or directory
: command not found
: No such file or directory
Usage: npm <command>
where <command> is one of: (snip commands list)
(snip npm help)
npm@3.10.3 /usr/local/lib/node_modules/npm
: command not found
: No such file or directory
: command not found
Run Code Online (Sandbox Code Playgroud)
我真的不明白:
\r\n用\n(以防\r造成了问题),但它改变不了什么.dirname指令),或者它可能不知道cd …在 OSX 上,我需要从我的 CSV 文件中删除行尾 CR ( \r) 字符(表示为^M的输出cat -v):
$ cat -v myitems.csv
Run Code Online (Sandbox Code Playgroud)
输出:
strPicture,strEmail^M
image1xl.jpg,me@example.com^M
Run Code Online (Sandbox Code Playgroud)
我用 sed 和 perl 尝试了很多选项,但没有任何效果。
有任何想法吗?