Skip to content

Commit

Permalink
fix build plugin registration and Java output folder
Browse files Browse the repository at this point in the history
  • Loading branch information
LotharBender committed Nov 3, 2023
1 parent be3436f commit bc3fe78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions postgres/cds-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ if (!cds.env.fiori.lean_draft) {
}

cds.build?.register?.('postgres', {
impl: __dirname + '/lib/build.js',
taskDefaults: { src: cds.env.folders.db, dest: 'pg' }
impl: '@cap-js/postgres/lib/build.js',
taskDefaults: { src: cds.env.folders.db }
})
6 changes: 3 additions & 3 deletions postgres/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module.exports = class PostgresBuildPlugin extends cds.build.BuildPlugin {
promises.push(this.write({
dependencies: { '@sap/cds': '^7', '@cap-js/postgres': '^1' },
scripts: { start: 'cds-deploy' },
}).to('package.json'))
promises.push(this.write(cds.compile.to.json(model)).to(path.join('db', 'csn.json')))
}).to('pg/package.json'))
promises.push(this.write(cds.compile.to.json(model)).to(path.join('pg/db', 'csn.json')))

let data
if (fs.existsSync(path.join(this.task.src, 'data'))) {
Expand All @@ -25,7 +25,7 @@ module.exports = class PostgresBuildPlugin extends cds.build.BuildPlugin {
data = 'csv'
}
if (data) {
promises.push(this.copy(data).to(path.join('db', 'data')))
promises.push(this.copy(data).to(path.join('pg/db', 'data')))
}
return Promise.all(promises)
}
Expand Down

0 comments on commit bc3fe78

Please sign in to comment.