1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix creating missing package.json when existing project imported

Fixes #2115
This commit is contained in:
Nick O'Leary 2019-03-28 13:46:52 +00:00
parent 9832394f8e
commit 10839abf24
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -292,7 +292,7 @@ Project.prototype.update = function (user, data) {
if (data.hasOwnProperty('files')) { if (data.hasOwnProperty('files')) {
this.package['node-red'] = this.package['node-red'] || { settings: {}}; this.package['node-red'] = this.package['node-red'] || { settings: {}};
if (data.files.hasOwnProperty('package') && data.files.package !== fspath.join(this.paths.root,"package.json")) { if (data.files.hasOwnProperty('package') && (data.files.package !== fspath.join(this.paths.root,"package.json") || !this.paths['package.json'])) {
// We have a package file. It could be one that doesn't exist yet, // We have a package file. It could be one that doesn't exist yet,
// or it does exist and we need to load it. // or it does exist and we need to load it.
if (!/package\.json$/.test(data.files.package)) { if (!/package\.json$/.test(data.files.package)) {