meteor 命令文件shell 解析
#!/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 解析的更多相关文章
- shell解析命令行的过程以及eval命令
本文说明的是一条linux命令在执行时大致要经过哪些过程?以及这些过程的大致顺序. 1.1 shell解析命令行 shell读取和执行命令时的大致操作过程如下图: 以执行以下命令为例: echo -e ...
- (转)shell解析命令行的过程以及eval命令
shell解析命令行的过程以及eval命令 本文说明的是一条linux命令在执行时大致要经过哪些过程?以及这些过程的大致顺序. 1.1 shell解析命令行 shell读取和执行命令时的大致操作过 ...
- 命令行工具解析Crash文件,dSYM文件进行符号化
备份 文/爱掏蜂窝的熊(简书作者)原文链接:http://www.jianshu.com/p/0b6f5148dab8著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”. 序 在日常开发 ...
- Shell命令-文件及内容处理之more、less
文件及内容处理 - more.less 1. more:分页显示文件内容 more命令的功能说明 more 命令类似 cat,不过会以一页一页的形式显示,更方便使用者逐页阅读,而最基本的指令就是按空白 ...
- 一个简单的wed服务器SHTTPD(1)————命令行和文件配置解析
开始学习<LInux网络编程>中的综合案例,虽然代码书上有,还是自己打一下加深理解和印象. 主要有两个函数,完成命令行的解析,另一个实现配置文件的解析,注释还是比较丰富的哦. //star ...
- shell脚本 在后台执行de 命令 >> 文件 2>&1 将标准输出与错误输出共同写入到文件中(追加到原有内容的后面)
命令 >> 文件 2>&1或命令 &>> 文件 将标准输出与错误输出共同写入到文件中(追加到原有内容的后面) # ll >>aaa 2> ...
- 文件类型解析漏洞防御与攻击(PHP)
简介: 解析漏洞主要是一些特殊文件被iis.Apache.Nginx等服务在某种情况下解释成脚本文件格式并得以执行而产生的漏洞,一般的思路都是用图片木马来欺骗服务器,上传webshell,达到提权的目 ...
- sqlmap os shell解析
0x00 Background 最近遇到测试环境,最后利用sqlmap的--os-shell参数取得shell.一直以来,对这个参数的工作原理不是十分的清晰.大致的思想应该是将脚本插入到数据库中,然后 ...
- Linux命令行和shell编程
Shell Shell是一个程序,用户输入的命令通过shell来传达给内核或其它程序.用户在linux打开一个终端,终端就会自动调用用户的shell. Linux上的Shell有很多种,用的最多是sh ...
随机推荐
- docker 存储
[root@docker01 ~]# docker run --name b1 -v /data -it busybox / # ls bin data dev etc home proc root ...
- kali_linux学习笔记
kali linux ssh登陆: 一.配置SSH参数 修改sshd_config文件,命令为: vi /etc/ssh/sshd_config 将#PasswordAuthentication no ...
- python 编码拓展,小数据池,
编码拓展: 1.在所有类型的编码中,编码的二进制互不识别, 2.在传输的过程中不能是万国码的二进制解码传输, 因此将unicode变为utf - 8或者变成gbk编码尤为重要; 利用encode编码为 ...
- BZOJ4066:简单题
浅谈\(K-D\) \(Tree\):https://www.cnblogs.com/AKMer/p/10387266.html 题目传送门:https://lydsy.com/JudgeOnline ...
- 三、Jmeter--HTTP请求默认值(HTTP Request Defaults)和访问地址参数化
一.HTTP请求默认值(HTTP Request Defaults) 1. 在本地搭建了一个wordpress开源论坛,那么我每次访问论坛的地址(服务器名称或IP)是不变的,端口也是不变的,协议也是不 ...
- 前用户sudo免密码
Ubuntu 设置当前用户sudo免密码 方法1 # 备份 /etc/sudoers sudo cp /etc/sudoers . #打开 /etc/sudoers sudo visudo # 在 ...
- Oracle logminer 分析redo log(TOAD与PLSQL)
Oracle logminer 分析redo log Oracle 11g r2 RAC centos 6.5 设置时间格式 select to_char(sysdate,'yyyy-mm-dd hh ...
- IDA Pro权威指南学习笔记(一)
一直不懂逆向,最近刚好不忙,于是学习逆向,用来做笔记,顺便和大家分享交流. 参考书籍<IAD PRO权威指南> 工具: PETools: ETools 是另一款很好的PE文件编辑工具,以前 ...
- 基于windows平台的命令行软件安装工具Chocolatey的安装
本文介绍Chocolatey的安装和使用 Chocolatey 这是基于.NET Framework 4以上的windows安装软件的命令行工具 安装 第一步,打开你的powershell.exe,使 ...
- react核心知识点高度总结
本文系统的将react的语法以最简练的方式列举出来 安装 写在前面 JSX 组件的定义 state 生命周期 方法 条件渲染 列表 表单 组合嵌套 扩展语法 context传递props 错误拦截 r ...