【发布时间】:2019-12-11 09:13:44
【问题描述】:
Codenvy 是一个 IDE,当您工作的环境进入睡眠状态时,它会删除 gitignore 中的所有文件。所以每次我开始在 Codenvy 工作时,我都需要把这些文件放回去。这很麻烦,因此我试图为此添加 Codenvy 中称为命令(脚本)的内容。
我有以下几点:
1. cp vars-user-portal/variables.env user-portal/variables.env
2.
3. cp vars-user-portal/serviceAccountKey.json user-portal/serviceAccountKey.json
4.
5. cp vars-user-portal/.env user-portal/client/.env
6.
7. cd user-portal && npm install
8.
9. cd user-portal/client && npm install
10.
11. xdg-open user-portal/client/.env
当我运行这个命令时,我得到了输出:
/bin/bash: line 1: $'\r': command not found
/bin/bash: line 3: $'\r': command not found
/bin/bash: line 5: $'\r': command not found
Usage: npm <command>
...
Did you mean one of these?
install
uninstall
unstar
/bin/bash: line 7: $'\r': command not found
Usage: npm <command>
...
/bin/bash: line 9: $'\r': command not found
xdg-open: file '.env' does not exist
我的印象是,当一行中有空格时,它会将其视为单独的命令。知道如何让这个脚本工作吗?
【问题讨论】:
-
检查您的文件是否有特殊字符:
cat -A file或cat -v file
标签: bash terminal command codenvy