return non-zero status if gitlab-projects or gitlab-keys cmd was not … · netdata-be/gitlab-shell@3018504 · GitHub
Skip to content

Commit 3018504

Browse files
committed
return non-zero status if gitlab-projects or gitlab-keys cmd was not successful
1 parent f0eb801 commit 3018504

6 files changed

Lines changed: 18 additions & 5 deletions

File tree

‎CHANGELOG‎

Lines changed: 3 additions & 0 deletions

‎VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.0
1+
1.2.0

‎bin/gitlab-keys‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ require_relative '../lib/gitlab_init'
1212
#
1313

1414
require File.join(ROOT_PATH, 'lib', 'gitlab_keys')
15-
GitlabKeys.new.exec
1615

17-
exit
16+
# Return non-zero if command execution was not successful
17+
if GitlabKeys.new.exec
18+
exit 0
19+
else
20+
exit 1
21+
end

‎bin/gitlab-projects‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ require_relative '../lib/gitlab_init'
1616
# /bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git
1717
#
1818
require File.join(ROOT_PATH, 'lib', 'gitlab_projects')
19-
GitlabProjects.new.exec
2019

21-
exit
20+
# Return non-zero if command execution was not successful
21+
if GitlabProjects.new.exec
22+
exit 0
23+
else
24+
exit 1
25+
end

‎lib/gitlab_keys.rb‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def exec
1818
when 'rm-key'; rm_key
1919
else
2020
puts 'not allowed'
21+
false
2122
end
2223
end
2324

‎lib/gitlab_projects.rb‎

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)