IntelliJ:将文件的内容粘贴到hastebin.com

时间:2015-05-29 09:50:25

标签: intellij-idea xubuntu

我正在寻找一种简单的方法将文件内容直接从IntelliJ粘贴到hastebin

但我没有为IntelliJ找到任何插件。 我在Xubuntu 14.12上运行IntelliJ。

提前谢谢

1 个答案:

答案 0 :(得分:0)

您好我们使用了以下解决方案:https://github.com/seejohnrun/haste-client

在Intellij中使用简单的Bash脚本和外部工具。

Bash脚本:

#!/bin/bash
hastepost() { a=$(cat); curl -X POST -s -d "$a" hastebin.com/documents | awk -F '"' '{print "hastebin.com/"$4}'; }

url=$(cat $1 | hastepost)
echo $url
xdg-open $url

如果执行完成后不需要打开浏览器,只需删除bash脚本的最后一行。

然后使用以下参数在Intellij中创建一个新的外部工具

enter image description here

/home/user/Dev/TOOLS/hastebin/hastebin.sh是bash脚本的路径。