Skip to content
Snippets Groups Projects

Add 'gdk' command wrapper and gem

Merged Jacob Vosmaer (GitLab) requested to merge gdk-cli into master
1 unresolved thread
7 files
+ 74
30
Compare changes
  • Side-by-side
  • Inline
Files
7
bin/gdk 0 → 100755
+ 30
0
 
#!/usr/bin/env ruby
 
require 'fileutils'
 
 
def main
 
case ARGV.first
 
when 'init'
 
system(*%W(git clone -b gdk-cli https://gitlab.com/gitlab-org/gitlab-development-kit.git))
 
else
 
$gdk_root = find_root(Dir.pwd)
 
if $gdk_root.nil?
 
puts "Could not find GDK_ROOT in the current directory or any of its parents."
 
return false
 
end
 
puts "(in #{$gdk_root})"
 
load(File.join($gdk_root, 'lib/gdk.rb'))
 
GDK::main
 
end
 
end
 
 
def find_root(current)
 
if File.exist?(File.join(current, 'GDK_ROOT'))
 
File.realpath(current)
 
elsif File.realpath(current) == '/'
 
nil
 
else
 
find_root(File.join(current, '..'))
 
end
 
end
 
 
exit(main)
Loading