Skip to content

Commit c3a6d8f

Browse files
committed
making run-server script less dependent on starting from a particular
path
1 parent 5906404 commit c3a6d8f

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

spec/ldap/run-server

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
#!/usr/bin/env ruby
22

33
require 'erb'
4+
require 'fileutils'
5+
6+
FileUtils.chdir(File.dirname(__FILE__))
47

58
## For OSX:
69
ENV['PATH'] = "#{ENV['PATH']}:/usr/libexec"
710

8-
def file(n)
9-
File.read(File.expand_path(n, File.dirname(__FILE__)))
10-
end
11-
12-
template = file('slapd-test.conf.erb')
13-
normal_out = File.expand_path('slapd-test.conf', File.dirname(__FILE__))
14-
ssl_out = File.expand_path('slapd-ssl-test.conf', File.dirname(__FILE__))
11+
template = File.read('slapd-test.conf.erb')
12+
normal_out = 'slapd-test.conf'
13+
ssl_out = 'slapd-ssl-test.conf'
1514

16-
@conf_root = File.expand_path(File.dirname(__FILE__))
1715
File.open(normal_out, 'w') do |f|
1816
@ssl = false
1917
f.write ERB.new(template).result(binding)

0 commit comments

Comments
 (0)