Commit e28f75c8 authored by Ash McKenzie's avatar Ash McKenzie

Merge branch '173-remove-bin-install-command' into 'master'

Decouple `bin/compile` and `bin/install` from code in `lib/`

See merge request gitlab-org/gitlab-shell!340
parents 1ee64eea 1a3e687f
#!/usr/bin/env ruby #!/usr/bin/env ruby
require_relative '../lib/gitlab_init' # Load ROOT_PATH and access the minimum necessary config file
require_relative '../support/go_build'
# require_relative '../support/gitlab_config'
# GitLab shell, invoked from ~/.ssh/authorized_keys
#
config = GitlabConfig.new config = GitlabConfig.new
key_dir = File.dirname("#{config.auth_file}") key_dir = File.dirname("#{config.auth_file}")
......
require 'yaml'
class GitlabConfig
attr_reader :config
def initialize
@config = YAML.load_file(File.join(ROOT_PATH, 'config.yml'))
end
def auth_file
@config['auth_file'] ||= File.join(Dir.home, '.ssh/authorized_keys')
end
end
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
require 'fileutils' require 'fileutils'
# This will set the ROOT_PATH variable # Determine the root of the gitlab-shell directory
require_relative '../lib/gitlab_init' ROOT_PATH = ENV.fetch('GITLAB_SHELL_DIR', File.expand_path('..', __dir__))
module GoBuild module GoBuild
GO_DIR = File.join(ROOT_PATH, 'go') GO_DIR = File.join(ROOT_PATH, 'go')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment