Last active
October 15, 2015 08:20
-
-
Save tnj/23711bf9ad60e3a307b3 to your computer and use it in GitHub Desktop.
Vagrant ssh-config cache wrapper for IntelliJ Vagrant plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script is a quick hack/workaround for | |
# https://youtrack.jetbrains.com/issue/PY-12711 | |
# | |
# Open settings and set this script as an alternative to `vagrant` command | |
# to minimize lag in Vagrant plugin of IntelliJ IDEA (RubyMine, etc.) | |
VAGRANT="/usr/bin/vagrant" | |
CACHE_BASE="/tmp/vagrant-ssh-config" | |
CONFIG_CACHE="$CACHE_BASE.$(pwd | md5)" | |
if [ "$1" = "ssh-config" ]; then | |
if [ ! -e "$CONFIG_CACHE" ]; then | |
$VAGRANT "$@" > "$CONFIG_CACHE" | |
fi | |
cat "$CONFIG_CACHE" | |
exit | |
elif [ "$1" = "up" ]; then | |
rm "$CONFIG_CACHE" 2> /dev/null | |
fi | |
$VAGRANT "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment