从github安装curl'ed脚本: [英] Install script curl'ed from github:

查看:39
本文介绍了从github安装curl'ed脚本:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Github上托管了以下脚本: https://rawgit.com/oresoftware/quicklock/master/install.sh

I have the following script hosted on Github: https://rawgit.com/oresoftware/quicklock/master/install.sh

该文件的内容为:

#!/usr/bin/env bash

set -e;
cd "$HOME"
mkdir -p "$HOME/.quicklock/locks"
curl https://rawgit.com/oresoftware/quicklock/master/install.sh > "$HOME/.quicklock/ql.sh"

echo "To complete installation of 'quicklock' add the following line to your .bash_profile file:";
echo ". \"$HOME/.quicklock/ql.sh\"";

我使用以下命令下载并运行此脚本:

I download and run this script with:

curl -o- https://rawgit.com/oresoftware/quicklock/master/install.sh | bash

但我收到此错误:

bash:第1行:已移动:找不到命令

bash: line 1: Moved: command not found

该错误使我丧命,我无法弄清楚是什么原因造成的.我尝试同时使用 -o-选项和不使用curl的情况.

That error is killing me, I cannot figure out what is causing it. I tried curl with both the -o- option and without.

推荐答案

原始git的网址已更改,其错误来自curl.

The url for raw git has changed, the error itsel is from curl.

rawgit.com 更改为 raw.githubusercontent.com .

另一种选择是添加 -L 以使 curl 跟随重定向链接.

Another option is to add -L to have curl follow the redirect link.

我通过将 bash 更改为 bash -x 来解决这个问题.这是输出:

I figured this out by changing bash to bash -x. Here is the output:

curl -o- https://rawgit.com/oresoftware/quicklock/master/install.sh | bash -x
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   107  100   107    0     0    400      0 --:--:-- --:--:-- --:--:--   402
+(:1): Moved Permanently. Redirecting to https://raw.githubusercontent.com/oresoftware/quicklock/master/install.sh
bash: line 1: Moved: command not found

这篇关于从github安装curl'ed脚本:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆