1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-11-26 23:33:03 +00:00

fix path for require lib

This commit is contained in:
nishiki 2016-07-10 18:55:18 +02:00
parent 55342597ac
commit 13b025df2b
3 changed files with 10 additions and 17 deletions

15
bin/mpw
View file

@ -16,11 +16,15 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
$: << File.expand_path('../../lib', __FILE__)
require 'optparse'
require 'pathname'
require 'locale'
require 'set'
require 'i18n'
require 'mpw/mpw'
require 'mpw/config'
require 'mpw/cli'
# --------------------------------------------------------- #
# Set local
@ -32,15 +36,8 @@ if defined?(I18n.enforce_available_locales)
I18n.enforce_available_locales = true
end
APP_ROOT = File.dirname(Pathname.new(__FILE__).realpath)
# TODO
require "#{APP_ROOT}/../lib/mpw/mpw.rb"
require "#{APP_ROOT}/../lib/mpw/config.rb"
require "#{APP_ROOT}/../lib/mpw/ui/cli.rb"
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
I18n.load_path = Dir["#{APP_ROOT}/../i18n/*.yml"]
I18n.load_path = Dir["#{File.expand_path('../../i18n', __FILE__)}/*.yml"]
I18n.default_locale = :en
I18n.locale = lang.to_sym

View file

@ -21,10 +21,8 @@ require 'i18n'
require 'colorize'
require 'highline/import'
require 'clipboard'
#TODO
require "#{APP_ROOT}/../lib/mpw/item.rb"
require "#{APP_ROOT}/../lib/mpw/mpw.rb"
require 'mpw/item'
require 'mpw/mpw'
module MPW
class Cli

View file

@ -20,9 +20,7 @@ require 'rubygems/package'
require 'gpgme'
require 'i18n'
require 'yaml'
#TODO
require "#{APP_ROOT}/../lib/mpw/item.rb"
require 'mpw/item'
module MPW
class MPW
@ -325,7 +323,7 @@ class MPW
case @config['sync']['type']
when 'sftp', 'scp', 'ssh'
require "#{APP_ROOT}/../lib/mpw/sync/ssh.rb"
require "mpw/sync/ssh"
sync = SyncSSH.new(@config['sync'])
when 'ftp'
require 'mpw/sync/ftp'