#!/bin/bash

# This is the script that we install somewhere in your $PATH (as "meteor")
# when you run
# $ curl https://install.meteor.com/ | sh
# In fact, all that the curl script does is install this script and run it
# once. It's the only file that we install globally on your system; each user of
# Meteor gets their own personal package and tools repository, called the
# warehouse, in ~/.meteor/. This means that a user can share packages among
# multiple apps and automatically update to new releases without having to have
# permissions to write them to anywhere global.
#
# All this script does is exec ~/.meteor/meteor. But what if you don't have it
# yet? In that case, it downloads a "bootstrap tarball", which contains the
# latest version of the Meteor tools, and plops it down at ~/.meteor. In fact,
# once you've run this once, you don't even really need this script: you can put
# ~/.meteor/ into your PATH, or a symlink to ~/.meteor/meteor into some other
# PATH directory. No special permissions needed!
# 脚本的目的在于运行 ~/.meteor/meteor。它会下载一个包:bootstrap tarball,包含了最新
# 版本的Meteor的工具,存放在~/.meteor文件夹下面。事实上,你只要已经运行过一次,你就可
# 不许要这个脚本:你可以把~/.meteor/路径放到你的PATH目录下面,或者加一个链接到PATH目录
# 下面,不许要额外的权限。
#
# To uninstall Meteor from your system, just delete this shell script, and
# delete your warehouse (~/.meteor/).
# 卸载就直接删除~/.meteor/文件夹就行了。
#
# We'll keep around a copy of this file at
# ~/.meteor/engines/latest/launch-meteor just in case you ever want to find it
# again. And if you put it somewhere that other users on your system can run it,
# then when they run it they'll get their very own warehouse too!
# ~/.meteor/engines/latest/launch-meteor 是这个文件的副本,如果你把这个共享给了其他
# 用,那么他们也会有自己的仓库。

set -e
set -u
set -o pipefail # so curl failure triggers the "set -e"

# 设置两个地址
BOOTSTRAP_URL='https://install-bootstrap.meteor.com/'
METEOR_WAREHOUSE_DIR="${METEOR_WAREHOUSE_DIR:-$HOME/.meteor}"

if [ ! -x "$METEOR_WAREHOUSE_DIR/meteor" ]; then # 测试目录
if [ -e "$METEOR_WAREHOUSE_DIR" ]; then
echo "'$METEOR_WAREHOUSE_DIR' exists, but '$METEOR_WAREHOUSE_DIR/meteor' is not executable." 1>&2
echo 1>&2
echo "Remove it and try again." 1>&2
exit 1
fi # 发现仓库路径 但路径里面出现错误

# Bootstrap .meteor from a tarball. First, figure out our architecture.

UNAME=$(uname)
if [ "$UNAME" != "Linux" -a "$UNAME" != "Darwin" ] ; then
echo "Sorry, this OS is not supported yet." 1>&2
exit 1
fi # 系统是否正确

# If you change this, also change host() in tools/archinfo.js
if [ "$UNAME" = "Darwin" ] ; then # osx 系统
if [ "i386" != "$(uname -p)" -o "1" != "$(sysctl -n hw.cpu64bit_capable 2>/dev/null || echo 0)" ] ; then
# Can't just test uname -m = x86_64, because Snow Leopard can
# return other values.
echo "Only 64-bit Intel processors are supported at this time." 1>&2
exit 1 # osx 一定需要64位
fi
ARCH="x86_64"
elif [ "$UNAME" = "Linux" ] ; then # linux 系统
ARCH="$(uname -m)"
if [ "$ARCH" != "i686" -a "$ARCH" != "x86_64" ] ; then
echo "Unsupported architecture: $ARCH" 1>&2
echo "Meteor only supports i686 and x86_64 for now." 1>&2
exit 1 # 32和64都需要
fi
fi
PLATFORM="${UNAME}_${ARCH}" # 平台字符串

# This returns something like https://warehouse.meteor.com/bootstrap/0.6.1
ROOT_URL="$(curl -s --fail $BOOTSTRAP_URL)" # 判断是否提供
TARBALL_URL="${ROOT_URL}/meteor-bootstrap-${PLATFORM}.tar.gz" # 工具包地址

INSTALL_TMPDIR="$(dirname "$METEOR_WAREHOUSE_DIR")/.meteor-install-tmp" # 安装是的临时目录
rm -rf "$INSTALL_TMPDIR" # 清空安装临时目录
mkdir "$INSTALL_TMPDIR" # 创建目录
if [ -n "$USER" ]; then # 提示
echo "$USER, this is your first time using Meteor!" 1>&2
else
echo "This is your first time using Meteor!" 1>&2
fi
echo "Installing a Meteor distribution in your home directory." 1>&2
curl --progress-bar --fail "$TARBALL_URL" | tar -xzf - -C "$INSTALL_TMPDIR" # 下载工具包并且解压到临时目录里面
# bomb out if it didn't work, eg no net
test -x "${INSTALL_TMPDIR}/.meteor/meteor" # 是否有目录
mv "${INSTALL_TMPDIR}/.meteor" "$METEOR_WAREHOUSE_DIR"
rmdir "${INSTALL_TMPDIR}" # 删除临时文件
# just double-checking :)
test -x "$METEOR_WAREHOUSE_DIR/meteor" # 是否安装好
fi

exec "$METEOR_WAREHOUSE_DIR/meteor" "$@" # 执行

meteor 命令文件shell 解析的更多相关文章

  1. shell解析命令行的过程以及eval命令

    本文说明的是一条linux命令在执行时大致要经过哪些过程?以及这些过程的大致顺序. 1.1 shell解析命令行 shell读取和执行命令时的大致操作过程如下图: 以执行以下命令为例: echo -e ...

  2. (转)shell解析命令行的过程以及eval命令

    shell解析命令行的过程以及eval命令   本文说明的是一条linux命令在执行时大致要经过哪些过程?以及这些过程的大致顺序. 1.1 shell解析命令行 shell读取和执行命令时的大致操作过 ...

  3. 命令行工具解析Crash文件,dSYM文件进行符号化

    备份   文/爱掏蜂窝的熊(简书作者)原文链接:http://www.jianshu.com/p/0b6f5148dab8著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”. 序 在日常开发 ...

  4. Shell命令-文件及内容处理之more、less

    文件及内容处理 - more.less 1. more:分页显示文件内容 more命令的功能说明 more 命令类似 cat,不过会以一页一页的形式显示,更方便使用者逐页阅读,而最基本的指令就是按空白 ...

  5. 一个简单的wed服务器SHTTPD(1)————命令行和文件配置解析

    开始学习<LInux网络编程>中的综合案例,虽然代码书上有,还是自己打一下加深理解和印象. 主要有两个函数,完成命令行的解析,另一个实现配置文件的解析,注释还是比较丰富的哦. //star ...

  6. shell脚本 在后台执行de 命令 >> 文件 2>&1 将标准输出与错误输出共同写入到文件中(追加到原有内容的后面)

    命令 >> 文件 2>&1或命令 &>> 文件 将标准输出与错误输出共同写入到文件中(追加到原有内容的后面) # ll >>aaa 2> ...

  7. 文件类型解析漏洞防御与攻击(PHP)

    简介: 解析漏洞主要是一些特殊文件被iis.Apache.Nginx等服务在某种情况下解释成脚本文件格式并得以执行而产生的漏洞,一般的思路都是用图片木马来欺骗服务器,上传webshell,达到提权的目 ...

  8. sqlmap os shell解析

    0x00 Background 最近遇到测试环境,最后利用sqlmap的--os-shell参数取得shell.一直以来,对这个参数的工作原理不是十分的清晰.大致的思想应该是将脚本插入到数据库中,然后 ...

  9. Linux命令行和shell编程

    Shell Shell是一个程序,用户输入的命令通过shell来传达给内核或其它程序.用户在linux打开一个终端,终端就会自动调用用户的shell. Linux上的Shell有很多种,用的最多是sh ...

随机推荐

  1. centos 下配置oracle11gR2开机自启

    这里使用的环境是 CentOS 6.6 ,并且已经装好了oracle11gR2 oracle启动分为两个步骤: 1.启动监听 2.启动服务 1.root 用户下修改ORATAB(将N该为Y): [ro ...

  2. [HDU5324]Boring Class

    vjudge sol 字典序最小可以通过倒着\(dp\)解决.对每个\(i\)记录它可以转移到的\(dp\)值最大且字典序最小的\(nxt_i\). 尝试着写一下\(dp\)式子. \[dp_i=ma ...

  3. 基于Python语言使用RabbitMQ消息队列(一)

    介绍 RabbitMQ 是一个消息中间人(broker): 它接收并且发送消息. 你可以把它想象成一个邮局: 当你把想要寄出的信放到邮筒里时, 你可以确定邮递员会把信件送到收信人那里. 在这个比喻中, ...

  4. tp验证码

    一.生成验证码 1.commonController.class.php class CommonController extends Controller{ public function getV ...

  5. 类和对象(12)—— this指针

    首先,我们都知道类的成员函数可以访问类的数据(限定符只是限定于类外的一些操作,类内的一切对于成员函数来说都是透明的),那么成员函数如何知道哪个对象的数据成员要被操作呢,原因在于每个对象都拥有一个指针: ...

  6. 皮肤和DLL和图片等项目文件完全整合到exe中

    C#开发的程序原生界面实在是太丑了,自己又没有美化天赋,所以只能使用皮肤控件了,网上找到了IrisSkin2,包含一个.dll文件和若干ssk后缀的皮肤文件,代码其实很简单的.但是后来发现个问题,就是 ...

  7. Tomcat设计模式分析(转) 2

    Tomcat 系统架构与设计模式,第 2 部分: 设计模式分析 这个分为两个部分的系列文章研究了 Apache Tomcat 服务器的系统架构以及其运用的很多经典设计模式.第 1 部分 分析了 Tom ...

  8. Linux网络编程学习路线

    转载自:https://blog.csdn.net/lianghe_work/article 一.网络应用层编程   1.Linux网络编程01——网络协议入门 2.Linux网络编程02——无连接和 ...

  9. docker 摆渡镜像脚本

    #!/bin/bash if [ $# != 1 ];then echo "Param error";exit; fi DOCKER_NAME=$1 IMAGE_TAG=${DOC ...

  10. NuGet学习笔记(2)——vs2015搭建本地NuGet服务器

    搭建本地服务器特别简单,新建一个web空项目,按照下图所示搜索安装即可,之后设置hosts 将www.mynuget.com执向本机 运行里面输入c:\windows\system32\drivers ...