Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/src/commands/socket-add.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class SocketAdd {
}
} else {
echo()
if(err.message) {
if (err.message) {
echo(`${format.red(err.message)}\n`)
} else {
echo(`${format.red(err)}\n`)
Expand Down
19 changes: 11 additions & 8 deletions packages/cli/src/utils/sockets/sockets.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class Socket {
this.isProjectRegistryDependency = null
this.dependencies = []
this.dependencyOf = []
this.envIsNull = false

// that looks stupid
this.remote = {
Expand Down Expand Up @@ -557,8 +558,8 @@ class Socket {
}

isEmptyEnv () {
debug('isEmptyEnv', !fs.existsSync(this.getSocketEnvZip()))
return !fs.existsSync(this.getSocketEnvZip())
debug('isEmptyEnv', this.envIsNull)
return this.envIsNull
}

getSocketNodeModulesChecksum () {
Expand Down Expand Up @@ -821,11 +822,11 @@ class Socket {
archive.finalize()
} else {
fs.unlinkSync(this.getSocketEnvZip())
resolve()
resolve(false)
}

output.on('close', () => {
resolve()
resolve(true)
})
})
}
Expand Down Expand Up @@ -889,9 +890,11 @@ class Socket {
debug('updateEnv')
const resp = await this.socketEnvShouldBeUpdated()
if (resp) {
await this.createEnvZip()
if (!this.isEmptyEnv()) {
const zip = await this.createEnvZip()
if (zip) {
return this.updateEnvCall(resp)
} else {
this.envIsNull = true
}
}
return 'No need to update'
Expand Down Expand Up @@ -1026,7 +1029,7 @@ class Socket {
// Build registry socket.
try {
await this.build()
} catch(e) {
} catch (e) {
return reject(e)
}
return resolve()
Expand All @@ -1049,7 +1052,7 @@ class Socket {
args.split(' '),
{
cwd: this.getSocketPath(),
maxBuffer: 2048 * 1024,
maxBuffer: 2048 * 4096,
stdio: [process.stdio, 'pipe', 'pipe']
}
)
Expand Down