diff --git a/app/install.cmd b/app/install.cmd old mode 100644 new mode 100755 diff --git a/app/install.sh b/app/install.sh old mode 100644 new mode 100755 diff --git a/app/out/404.html b/app/out/404.html index e971656..d9f47dc 100644 --- a/app/out/404.html +++ b/app/out/404.html @@ -1 +1 @@ -
404
\ No newline at end of file +
404
\ No newline at end of file diff --git a/app/out/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/404.js b/app/out/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/404.js similarity index 100% rename from app/out/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/404.js rename to app/out/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/404.js diff --git a/app/out/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/_app.js b/app/out/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/_app.js similarity index 100% rename from app/out/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/_app.js rename to app/out/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/_app.js diff --git a/app/out/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/_error.js b/app/out/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/_error.js similarity index 100% rename from app/out/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/_error.js rename to app/out/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/_error.js diff --git a/app/out/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/index.js b/app/out/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/index.js similarity index 100% rename from app/out/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/index.js rename to app/out/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/index.js diff --git a/app/out/index.html b/app/out/index.html index c9ad960..72dc673 100644 --- a/app/out/index.html +++ b/app/out/index.html @@ -1 +1 @@ -「Preview Page」
\ No newline at end of file +「Preview Page」
\ No newline at end of file diff --git a/autoload/mkdp/util.vim b/autoload/mkdp/util.vim index 21527ed..91afe28 100644 --- a/autoload/mkdp/util.vim +++ b/autoload/mkdp/util.vim @@ -61,6 +61,16 @@ function! mkdp#util#get_platform() abort return 'linux' endfunction +function! s:OnExit(autoclose, bufnr, Callback, job_id, status, ...) + let content = join(getbufline(a:bufnr, 1, '$'), "\n") + if a:status == 0 && a:autoclose == 1 + execute 'silent! bd! '.a:bufnr + endif + if !empty(a:Callback) + call call(a:Callback, [a:status, a:bufnr, content]) + endif +endfunction + function! mkdp#util#open_terminal(opts) abort if get(a:opts, 'position', 'bottom') ==# 'bottom' let p = '5new' @@ -99,7 +109,7 @@ function! mkdp#util#open_terminal(opts) abort return bufnr endfunction -function! s:markdown_preview_installed() abort +function! s:markdown_preview_installed(...) abort echo '[markdown-preview.nvim]: install cpmpleted' endfunction diff --git a/package.json b/package.json index a372687..492da0e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "markdown-preview.vim", - "version": "0.0.1", + "version": "0.0.2", "description": "markdown preview plugin for (neo)vim", "bin": "./app/server.js", "repository": "https://github.com/iamcco/markdown-preview.vim.git", diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..57945de --- /dev/null +++ b/release.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +set -e +[ "$TRACE" ] && set -x + +# Create tag and push +tag="v$(node -p "require('./package.json').version")" +git tag -f "$tag" -m "Release $tag" +git push --tags + +GH_API="https://api.github.com" +GH_REPO="$GH_API/repos/iamcco/markdown-preview.nvim" +GH_TAGS="$GH_REPO/releases/tags/$tag" +AUTH="Authorization: token $GITHUB_API_TOKEN" + +echo "Creating release for $tag" +curl -X POST -H "Authorization: token $GITHUB_API_TOKEN" \ + -H "Content-Type: application/json" \ + --data "{\"tag_name\":\"$tag\"}" \ + "$GH_REPO/releases" + +# upload assets +cd ./app/bin +tar -zcf markdown-preview-macos.tar.gz markdown-preview-macos +tar -zcf markdown-preview-linux.tar.gz markdown-preview-linux +zip markdown-preview-win.zip markdown-preview-win.exe + +declare -a files=("markdown-preview-win.zip" "markdown-preview-macos.tar.gz" "markdown-preview-linux.tar.gz") + +# Validate token. +curl -o /dev/null -sH "$AUTH" $GH_REPO || { echo "Error: Invalid repo, token or network issue!"; exit 1; } + +# Read asset tags. +response=$(curl -sH "$AUTH" $GH_TAGS) + +# Get ID of the asset based on given filename. +eval $(echo "$response" | grep -m 1 "id.:" | grep -w id | tr : = | tr -cd '[[:alnum:]]=') +[ "$id" ] || { echo "Error: Failed to get release id for tag: $tag"; echo "$response" | awk 'length($0)<100' >&2; exit 1; } + +# Upload asset +for filename in "${files[@]}" +do + GH_ASSET="https://uploads.github.com/repos/iamcco/markdown-preview.nvim/releases/$id/assets?name=$filename" + echo "Uploading $filename" + curl -X POST -H "Authorization: token $GITHUB_API_TOKEN" \ + -H "Content-Type: application/octet-stream" \ + --data-binary @"$filename" \ + $GH_ASSET +done