node-pty 1.1.0 → 1.2.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "Microsoft Corporation"
6
6
  },
7
- "version": "1.1.0",
7
+ "version": "1.2.0-beta.1",
8
8
  "license": "MIT",
9
9
  "main": "./lib/index.js",
10
10
  "types": "./typings/node-pty.d.ts",
@@ -30,7 +30,7 @@ function getNextBetaVersion() {
30
30
  const nextStableVersion = `${stableVersion[0]}.${parseInt(stableVersion[1]) + 1}.0`;
31
31
  const publishedVersions = getPublishedVersions(nextStableVersion, tag);
32
32
  if (publishedVersions.length === 0) {
33
- return `${nextStableVersion}-${tag}1`;
33
+ return `${nextStableVersion}-${tag}.1`;
34
34
  }
35
35
  const latestPublishedVersion = publishedVersions.sort((a, b) => {
36
36
  const aVersion = parseInt(a.substr(a.search(/[0-9]+$/)));
@@ -38,7 +38,7 @@ function getNextBetaVersion() {
38
38
  return aVersion > bVersion ? -1 : 1;
39
39
  })[0];
40
40
  const latestTagVersion = parseInt(latestPublishedVersion.substr(latestPublishedVersion.search(/[0-9]+$/)), 10);
41
- return `${nextStableVersion}-${tag}${latestTagVersion + 1}`;
41
+ return `${nextStableVersion}-${tag}.${latestTagVersion + 1}`;
42
42
  }
43
43
 
44
44
  function getPublishedVersions(version, tag) {
@@ -48,7 +48,7 @@ function getPublishedVersions(version, tag) {
48
48
  cp.spawnSync('npm', ['view', packageJson.name, 'versions', '--json']);
49
49
  const versionsJson = JSON.parse(versionsProcess.stdout);
50
50
  if (tag) {
51
- return versionsJson.filter(v => !v.search(new RegExp(`${version}-${tag}[0-9]+`)));
51
+ return versionsJson.filter(v => !v.search(new RegExp(`${version}-${tag}\.[0-9]+`)));
52
52
  }
53
53
  return versionsJson;
54
54
  }
package/src/unix/pty.cc CHANGED
@@ -370,7 +370,7 @@ Napi::Value PtyFork(const Napi::CallbackInfo& info) {
370
370
  int err = -1;
371
371
  pty_posix_spawn(argv, env, term, &winp, &master, &pid, &err);
372
372
  if (err != 0) {
373
- throw Napi::Error::New(napiEnv, "posix_spawnp failed.");
373
+ throw Napi::Error::New(napiEnv, std::string("pty_posix_spawn failed with error: ") + std::to_string(err) + " (" + strerror(err) + ")");
374
374
  }
375
375
  if (pty_nonblock(master) == -1) {
376
376
  throw Napi::Error::New(napiEnv, "Could not set master fd to nonblocking.");