Skip to content

Commit

Permalink
0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
iamcco committed Oct 27, 2018
1 parent 6189997 commit cb8cb01
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 4 deletions.
Empty file modified app/install.cmd
100644 → 100755
Empty file.
Empty file modified app/install.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion app/out/404.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charSet="utf-8" class="next-head"/><link rel="preload" href="/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/404.js" as="script"/><link rel="preload" href="/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/_app.js" as="script"/><link rel="preload" href="/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/_error.js" as="script"/><link rel="preload" href="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" as="script"/><link rel="preload" href="/_next/static/chunks/commons.607563dfda4be1bfab75.js" as="script"/><link rel="preload" href="/_next/static/runtime/main-58f0623ae31923c6e6ec.js" as="script"/></head><body><div id="__next"><div data-reactroot="">404</div></div><script>__NEXT_DATA__ = {"props":{"pageProps":{}},"page":"/404","query":{},"buildId":"VhSEXTA_sY1ZofYXuRiop","nextExport":true};__NEXT_LOADED_PAGES__=[];__NEXT_REGISTER_PAGE=function(r,f){__NEXT_LOADED_PAGES__.push([r, f])}</script><script async="" id="__NEXT_PAGE__/404" src="/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/404.js"></script><script async="" id="__NEXT_PAGE__/_app" src="/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/_app.js"></script><script async="" id="__NEXT_PAGE__/_error" src="/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/_error.js"></script><script src="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" async=""></script><script src="/_next/static/chunks/commons.607563dfda4be1bfab75.js" async=""></script><script src="/_next/static/runtime/main-58f0623ae31923c6e6ec.js" async=""></script></body></html>
<!DOCTYPE html><html><head><meta charSet="utf-8" class="next-head"/><link rel="preload" href="/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/404.js" as="script"/><link rel="preload" href="/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/_app.js" as="script"/><link rel="preload" href="/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/_error.js" as="script"/><link rel="preload" href="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" as="script"/><link rel="preload" href="/_next/static/chunks/commons.607563dfda4be1bfab75.js" as="script"/><link rel="preload" href="/_next/static/runtime/main-58f0623ae31923c6e6ec.js" as="script"/></head><body><div id="__next"><div data-reactroot="">404</div></div><script>__NEXT_DATA__ = {"props":{"pageProps":{}},"page":"/404","query":{},"buildId":"cfr11ZXJI1UW5F2KqXMyK","nextExport":true};__NEXT_LOADED_PAGES__=[];__NEXT_REGISTER_PAGE=function(r,f){__NEXT_LOADED_PAGES__.push([r, f])}</script><script async="" id="__NEXT_PAGE__/404" src="/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/404.js"></script><script async="" id="__NEXT_PAGE__/_app" src="/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/_app.js"></script><script async="" id="__NEXT_PAGE__/_error" src="/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/_error.js"></script><script src="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" async=""></script><script src="/_next/static/chunks/commons.607563dfda4be1bfab75.js" async=""></script><script src="/_next/static/runtime/main-58f0623ae31923c6e6ec.js" async=""></script></body></html>
2 changes: 1 addition & 1 deletion app/out/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charSet="utf-8" class="next-head"/><title class="next-head">「Preview Page」</title><link rel="shortcut icon" type="image/ico" href="/_static/favicon.ico" class="next-head"/><link rel="stylesheet" href="/_static/markdown.css" class="next-head"/><link rel="stylesheet" href="/_static/highlight.css" class="next-head"/><link rel="stylesheet" href="/_static/[email protected]" class="next-head"/><script type="text/javascript" src="/_static/tweenlite.min.js" class="next-head"></script><link rel="preload" href="/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/index.js" as="script"/><link rel="preload" href="/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/_app.js" as="script"/><link rel="preload" href="/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/_error.js" as="script"/><link rel="preload" href="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" as="script"/><link rel="preload" href="/_next/static/chunks/commons.607563dfda4be1bfab75.js" as="script"/><link rel="preload" href="/_next/static/runtime/main-58f0623ae31923c6e6ec.js" as="script"/></head><body><div id="__next"><section class="markdown-body"></section></div><script>__NEXT_DATA__ = {"props":{"pageProps":{}},"page":"/","query":{},"buildId":"VhSEXTA_sY1ZofYXuRiop","nextExport":true};__NEXT_LOADED_PAGES__=[];__NEXT_REGISTER_PAGE=function(r,f){__NEXT_LOADED_PAGES__.push([r, f])}</script><script async="" id="__NEXT_PAGE__/" src="/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/index.js"></script><script async="" id="__NEXT_PAGE__/_app" src="/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/_app.js"></script><script async="" id="__NEXT_PAGE__/_error" src="/_next/static/VhSEXTA_sY1ZofYXuRiop/pages/_error.js"></script><script src="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" async=""></script><script src="/_next/static/chunks/commons.607563dfda4be1bfab75.js" async=""></script><script src="/_next/static/runtime/main-58f0623ae31923c6e6ec.js" async=""></script></body></html>
<!DOCTYPE html><html><head><meta charSet="utf-8" class="next-head"/><title class="next-head">「Preview Page」</title><link rel="shortcut icon" type="image/ico" href="/_static/favicon.ico" class="next-head"/><link rel="stylesheet" href="/_static/markdown.css" class="next-head"/><link rel="stylesheet" href="/_static/highlight.css" class="next-head"/><link rel="stylesheet" href="/_static/[email protected]" class="next-head"/><script type="text/javascript" src="/_static/tweenlite.min.js" class="next-head"></script><link rel="preload" href="/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/index.js" as="script"/><link rel="preload" href="/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/_app.js" as="script"/><link rel="preload" href="/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/_error.js" as="script"/><link rel="preload" href="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" as="script"/><link rel="preload" href="/_next/static/chunks/commons.607563dfda4be1bfab75.js" as="script"/><link rel="preload" href="/_next/static/runtime/main-58f0623ae31923c6e6ec.js" as="script"/></head><body><div id="__next"><section class="markdown-body"></section></div><script>__NEXT_DATA__ = {"props":{"pageProps":{}},"page":"/","query":{},"buildId":"cfr11ZXJI1UW5F2KqXMyK","nextExport":true};__NEXT_LOADED_PAGES__=[];__NEXT_REGISTER_PAGE=function(r,f){__NEXT_LOADED_PAGES__.push([r, f])}</script><script async="" id="__NEXT_PAGE__/" src="/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/index.js"></script><script async="" id="__NEXT_PAGE__/_app" src="/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/_app.js"></script><script async="" id="__NEXT_PAGE__/_error" src="/_next/static/cfr11ZXJI1UW5F2KqXMyK/pages/_error.js"></script><script src="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" async=""></script><script src="/_next/static/chunks/commons.607563dfda4be1bfab75.js" async=""></script><script src="/_next/static/runtime/main-58f0623ae31923c6e6ec.js" async=""></script></body></html>
12 changes: 11 additions & 1 deletion autoload/mkdp/util.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
49 changes: 49 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit cb8cb01

Please sign in to comment.