Skip to content

Commit

Permalink
use canonical cache dir
Browse files Browse the repository at this point in the history
  • Loading branch information
soheil committed Dec 7, 2015
1 parent e7a99c2 commit 6b46496
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ssh2
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
import subprocess, json, os
from optparse import OptionParser

cache_file_list = '/tmp/.ssh2_list'
cache_file_num = '/tmp/.ssh2_num'
cache_dir = os.environ.get('XDG_CACHE_HOME', os.path.join(os.path.expanduser('~'), '.cache'))
if not os.path.exists(cache_dir):
os.makedirs(cache_dir)
cache_file_list = os.path.join(cache_dir, 'ssh2_list')
cache_file_num = os.path.join(cache_dir, 'ssh2_num')

usage = "usage: %prog [options] [server_number]\n\
server_number: a numeric value corresponding to the server number\n\
Expand Down

0 comments on commit 6b46496

Please sign in to comment.