工作学习日志(shell-ruby-gem)

2016-11-19 12:16:28来源:oschina作者:lanrenol人点击

#!/bin/bash


#rvm use 2.3.0@rails-5


read -p "输入gem名称:" gem_name


read -p "请选择操作类型(a:创建/ r: 重新编辑):" operate_type if [ $operate_type == 'r' ] then


cd $gem_name/ rake install gem build ${gem_name}.gemspec


elif [ $operate_type == 'a' ] then


if [ ! -x "$gem_name" ]; then


bundler gem $gem_name cd $gem_name/


for i in `grep -n "/

/|/" ${gem_name}.gemspec | awk '{print $1}' | replace ":" ""` do echo $i sed -i -e "${i}s|TODO:||" ${gem_name}.gemspec done


rake build rake install #rake release gem build ${gem_name}.gemspec


else echo "${gem_name}已经存在了,请先手动删除" fi


else


echo "非法操作"


fi

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台