Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Correct packageJsonPath determination in ord.js #108

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
9 changes: 7 additions & 2 deletions lib/ord.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ const cds = require("@sap/cds");
const defaults = require("./defaults");
const path = require("path");

const initializeAppConfig = (csn) => {
let packageJsonPath = path.join(cds.root, 'package.json')
const initializeAppConfig = (csn, modelPath = cds.root || process.cwd()) => {

if (typeof modelPath !== 'string') {
throw new TypeError(`Expected "modelPath" to be a string, but received ${typeof modelPath}: ${JSON.stringify(modelPath)}`);
}
nirooxx marked this conversation as resolved.
Show resolved Hide resolved

let packageJsonPath = path.join(modelPath, 'package.json')
let packageJson;
if (cds.utils.exists(packageJsonPath)) {
packageJson = require(packageJsonPath);
Expand Down
Loading