Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check existence of known_hosts file #50

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ysono
Copy link

@ysono ysono commented Sep 1, 2016

If the machine doing the compilation does not have a file at $HOME/.ssh/known_hosts, the compilation (repl or jar or uberjar) fails.

Right now I'm getting around the issue with below hack.

(defn touch [path]
  (with-open [writer (io/writer (io/file path)
                                :append true)]
    (spit writer "")))

(when-not (contains? (loaded-libs) 'clj-ssh.cli)
  (touch (str (System/getProperty "user.home") "/.ssh/known_hosts"))
  (load "/clj_ssh/cli")
  (alias 'my-alias 'clj-ssh.cli))

in lieu of (:require [clj-ssh.cli :as my-alias]).

No tests added, but I'm not sure how to add one without making it complicated with alter-root-var and proxy tricks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants