File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env ruby
2
- $:. unshift ( File . dirname ( __FILE__ ) + '/../lib' ) unless $:. include? ( File . dirname ( __FILE__ ) + '/../lib' )
3
2
4
- require File . dirname ( __FILE__ ) + '/../lib/loops'
3
+ # Add our lib dir to the load path
4
+ loops_lib_dir = File . dirname ( __FILE__ ) + '/../lib'
5
+ $LOAD_PATH. unshift ( loops_lib_dir ) unless $LOAD_PATH. include? ( loops_lib_dir )
6
+
7
+ # Load loops
8
+ require 'loops'
5
9
6
10
begin
7
11
# The dup is to keep ARGV intact, so that tools like ruby-debug can respawn.
8
12
failure = Loops ::CLI . execute
9
13
Kernel . exit ( failure ? 1 : 0 )
14
+
10
15
rescue SystemExit => e
11
16
Kernel . exit ( e . status )
17
+
12
18
rescue Exception => e
13
19
STDERR . puts ( "Unhandled exception: #{ e . message } (#{ e . class } )" )
14
20
STDERR . puts ( e . backtrace . join ( "\n " ) )
You can’t perform that action at this time.
0 commit comments