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:
parent
9832394f8e
commit
10839abf24
@ -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)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user