procodile 1.0.11 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/procodile +28 -14
- data/lib/procodile/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 507f12e0dc524f32be34c9dfaf80f1696dd6da41
|
4
|
+
data.tar.gz: ff6feb4c0ccf2d3f7db4972ded509729cc18ab50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 295a7caf4a5969807ed492ee3dad806dd120c060d73d21880af573c3f5fde655f941d0cf45fb8c32464ab24174fc9498ee229b1a63c70a999e4189ed2cb9dad2
|
7
|
+
data.tar.gz: af5cbb8a7678c306f1ce4844bef0c2e87e1d3126686d554aa015e26b33bad5531cc37818bc31d29534be4051eaacfc655aaf469283fc9b4acdea41bb1534f718
|
data/bin/procodile
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
trap("INT") { puts ; exit 1 }
|
4
4
|
|
5
|
+
ORIGINAL_ARGV = ARGV.join(' ')
|
6
|
+
|
5
7
|
$:.unshift(File.expand_path('../../lib', __FILE__))
|
6
8
|
|
7
9
|
require 'optparse'
|
@@ -66,29 +68,41 @@ else
|
|
66
68
|
if File.exist?(global_config_path)
|
67
69
|
global_config = YAML.load_file(global_config_path)
|
68
70
|
if global_config.is_a?(Array)
|
69
|
-
|
70
|
-
|
71
|
-
|
71
|
+
if ENV['PROCODILE_APP_ID']
|
72
|
+
app_id = ENV['PROCODILE_APP_ID'].to_i
|
73
|
+
preselect = true
|
72
74
|
else
|
73
|
-
puts "
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
if col == 2 || i == global_config.size - 1
|
79
|
-
puts
|
75
|
+
puts "There are multiple applications configured in #{global_config_path}"
|
76
|
+
if File.file?("Procfile")
|
77
|
+
puts "\e[45;37mChoose an appplication or press ENTER to use the current directory:\e[0m"
|
78
|
+
else
|
79
|
+
puts "\e[45;37mChoose an application:\e[0m"
|
80
80
|
end
|
81
|
+
global_config.each_with_index do |app, i|
|
82
|
+
col = i % 3
|
83
|
+
print "#{(i+1)}) #{app['name']}"[0,28].ljust(col != 2 ? 30 : 0, ' ')
|
84
|
+
if col == 2 || i == global_config.size - 1
|
85
|
+
puts
|
86
|
+
end
|
87
|
+
end
|
88
|
+
app_id = STDIN.gets.to_i
|
89
|
+
ENV['PROCODILE_APP_ID'] = app_id.to_s
|
90
|
+
preselect = false
|
81
91
|
end
|
82
|
-
|
92
|
+
|
83
93
|
if app_id == 0
|
84
94
|
if File.file?('Procfile')
|
85
|
-
|
95
|
+
unless preselect
|
96
|
+
puts "Skipping application selection... using current directory"
|
97
|
+
end
|
86
98
|
global_config = {}
|
87
99
|
else
|
88
100
|
exit 1
|
89
101
|
end
|
90
102
|
elsif app = global_config[app_id - 1]
|
91
|
-
|
103
|
+
unless preselect
|
104
|
+
puts "\e[35mYou selected #{app['name']}\e[0m"
|
105
|
+
end
|
92
106
|
global_config = app
|
93
107
|
else
|
94
108
|
puts "Invalid app number"
|
@@ -101,7 +115,7 @@ end
|
|
101
115
|
if global_config['user'] && ENV['USER'] != global_config['user']
|
102
116
|
if global_config['user_reexec']
|
103
117
|
$stderr.puts "\e[31mProcodile must be run as #{global_config['user']}. Re-executing as #{global_config['user']}...\e[0m"
|
104
|
-
exec
|
118
|
+
exec("sudo -E -u #{global_config['user']} -- #{$0} #{ORIGINAL_ARGV}")
|
105
119
|
else
|
106
120
|
$stderr.puts "\e[31mError: Procodile must be run as #{global_config['user']}\e[0m"
|
107
121
|
exit 1
|
data/lib/procodile/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: procodile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|