diff --git a/.gitignore b/.gitignore index b26601b..ecb0e2a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ *.out /.idea /output +/release diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..08f2378 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +GC=go +MAIN_GO_FILE=mysql_markdown.go +RELEASE_DIR=release + +build-unix : + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 ${GC} build -ldflags -w -o ${RELEASE_DIR}/mysql_markdown_unix ${MAIN_GO_FILE} + +build-mac : + CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 ${GC} build -ldflags -w -o ${RELEASE_DIR}/mysql_markdown_mac ${MAIN_GO_FILE} + +build-win : + CGO_ENABLED=0 GOOS=windows GOARCH=amd64 ${GC} build -ldflags -w -o ${RELEASE_DIR}/mysql_markdown_win ${MAIN_GO_FILE} + +build : + make build-unix + make build-mac + make build-win + +release : + make build + upx release/mysql_markdown_* + tar -czvf release/mysql_markdown_mac.tar.gz -C release/ mysql_markdown_mac + tar -czvf release/mysql_markdown_unix.tar.gz -C release/ mysql_markdown_unix + tar -czvf release/mysql_markdown_win.tar.gz -C release/ mysql_markdown_win + +clean : + @if [ -d ${RELEASE_DIR} ] ; then rm -rf ${RELEASE_DIR}; fi \ No newline at end of file diff --git a/README.md b/README.md index 40ecd4a..53679e0 100644 --- a/README.md +++ b/README.md @@ -26,23 +26,7 @@ ___ #### 安装 - -###### 1.curl -```bash -curl -fsSL "https://raw.githubusercontent.com/alicfeng/mysql_markdown/master/install" | sudo sh -``` - -###### 2.source -```bash -git clone https://github.com/alicfeng/mysql_markdown.git -cd mysql_markdown -go get "github.com/go-sql-driver/mysql" -go build -o /usr/local/bin/mysql_markdown mysql_markdown.go -chmod +x /usr/local/bin/mysql_markdown -``` - -###### 3.download -[https://dl.samego.com](https://dl.samego.com/#files%2Fpackage%2Fmysql_markdown) +[releases download](https://github.com/alicfeng/mysql_markdown/releases) @@ -102,4 +86,4 @@ md转其它类型的文档推荐使用 `typora` 工具 它支持如下转换格 ###### MD文件转PDF -![MySQL 表结构生成 Markdown转PDF 文档](https://upload-images.jianshu.io/upload_images/1678789-5b5d3abfc3454352.png) \ No newline at end of file +![MySQL 表结构生成 Markdown转PDF 文档](https://upload-images.jianshu.io/upload_images/1678789-5b5d3abfc3454352.png) diff --git a/build.sh b/build.sh deleted file mode 100755 index d538f35..0000000 --- a/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o release/mysql_markdown_mac mysql_markdown.go -CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o release/mysql_markdown_unix mysql_markdown.go -CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o release/mysql_markdown_win mysql_markdown.go -chmod +x release/mysql_markdown_* \ No newline at end of file diff --git a/install b/install.sh similarity index 91% rename from install rename to install.sh index dd52a0a..548feed 100755 --- a/install +++ b/install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -dl_dir="https://dl.samego.com/#files%2Fpackage%2Fmysql_markdown/" +dl_dir="https://github.com/alicfeng/mysql_markdown/releases/" if [[ "$(uname)" == "Darwin" ]]; then # Mac OS X