Skip to content

Commit

Permalink
fix(cap): Allow xs-app.json to be stored in project root instead of w…
Browse files Browse the repository at this point in the history
…ebapp folder
  • Loading branch information
Marcel Schork committed Oct 12, 2024
1 parent b7877ea commit 0b70001
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion generators/model/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,13 @@ export default class extends Generator {

case "SAP HTML5 Application Repository Service":
case "SAP Build Work Zone, standard edition":
xsappJsonPath = this.destinationPath(`${this.options.config.uimoduleName}/webapp/xs-app.json`)
// check if file is stored in webapp folder or project root
const webappPath = this.destinationPath(`${this.options.config.uimoduleName}/webapp/xs-app.json`)
if (fs.existsSync(webappPath)) {
xsappJsonPath = webappPath
} else {
xsappJsonPath = this.destinationPath(`${this.options.config.uimoduleName}/xs-app.json`)
}
break
}
const xsappJson = JSON.parse(fs.readFileSync(xsappJsonPath))
Expand Down

0 comments on commit 0b70001

Please sign in to comment.