Skip to content

Instantly share code, notes, and snippets.

@kitsuyui
Last active January 3, 2017 12:06
Show Gist options
  • Save kitsuyui/bda30b3a25375559040feb6719507239 to your computer and use it in GitHub Desktop.
Save kitsuyui/bda30b3a25375559040feb6719507239 to your computer and use it in GitHub Desktop.
macOS で textlint を右クリックのメニューから呼べるようにする ref: http://qiita.com/kitsuyui/items/07beca9ff6f04692bff5
this.run = (argv) => {
const app = Application.currentApplication();
app.includeStandardAdditions = true;
if (!argv[0]) {
app.displayAlert("OK");
return;
}
app.displayAlert(argv[0]);
};
$ npm install -g textlint
$ textlint --init
$ npm install -g textlint-rule-no-mix-dearu-desumasu
$ cat <<EOF > ~/.textlintrc
{
"rules": {
"no-mix-dearu-desumasu": true
}
}
EOF
export PATH='/usr/local/bin:/usr/bin:/bin'
/usr/bin/osascript -l JavaScript -e '
this.run = (argv) => {
const app = Application.currentApplication();
app.includeStandardAdditions = true;
if (!argv[0]) {
app.displayAlert("OK");
return;
}
app.displayAlert(argv[0]);
};' "$(cat - | /usr/local/bin/textlint --stdin 2>&1)"
export PATH='/usr/local/bin:/usr/bin:/bin'
cat - | /usr/local/bin/textlint --stdin 2>&1
/usr/bin/osascript -l JavaScript -e '(JavaScript コード)' "$( textlint 部分 )"
これはオレンジである。リンゴではないのです。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment