美文网首页
Mac下使用uao command

Mac下使用uao command

作者: Henry007 | 来源:发表于2018-11-10 17:51 被阅读105次

11月3号参加了SpringOne大会,看到Josh Long使用uao命令打开demo项目非常方便,就从网上找了一下怎么安装uao命令。

目的:使用自定的命令完成一些定制的工作,uao用于打开spring initializer 的压缩包项目,并直接解压以及使用IDE打开

实现原理:

  1. 安装w3m
brew install w3m
  1. 安装xdg-open
brew install libxslt xmlto
export XML_CATALOG_FILES="/usr/local/etc/xml/catalog"
git clone git://anongit.freedesktop.org/xdg/xdg-utils
cd xdg-utils
./configure --prefix=/usr/local/
make
make install
  1. 设置xml默认打开方式为Idea,可以参考下面链接,但要选择默认程序为Idea
https://www.jianshu.com/p/b612a4737668
  1. 编辑uao脚本,放入/usr/local/bin
#!/bin/sh
file=$1
dir=${file%%.*}
unzip $file
if [ -f "$dir/pom.xml" ]
then
    proj="$dir/pom.xml"
elif [ -f "$dir/build.gradle" ]
then
    proj="$dir/build.gradle"
fi
xdg-open $proj
  1. 运行uao
uao springonedemo.zip

相关文章

网友评论

      本文标题:Mac下使用uao command

      本文链接:https://www.haomeiwen.com/subject/vyttfqtx.html