Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

make api scripts work from any working directory

Christophe Bliard76e64b829370
diff --git a/script/api/spec b/script/api/spec
index dc1e8089520..e335b3ae0d2 100755
--- a/script/api/spec
+++ b/script/api/spec
@@ -11,7 +11,7 @@ require 'pathname'
require 'yaml'
require 'json'
-require './lib/api/open_api'
+require_relative '../../lib/api/open_api'
path = Pathname(__dir__).join("../../docs/api/apiv3/openapi-spec.yml")
spec = API::OpenAPI.assemble_spec path
diff --git a/script/api/validate_spec b/script/api/validate_spec
index 1dbe46074ed..71b58ed866e 100755
--- a/script/api/validate_spec
+++ b/script/api/validate_spec
@@ -3,7 +3,7 @@
require 'pathname'
require 'tempfile'
-openapi_yaml_spec_path = "./tmp/oas-generated.yml"
+openapi_yaml_spec_path = Pathname(__dir__).join('../../tmp/oas-generated.yml')
full_spec = `#{Pathname(__dir__).join('spec')} --format yaml`
status = 1