textrun-repo 0.0.13 → 0.1.2
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/dist/executable.js +3 -0
- package/dist/existing-file-content.js +4 -1
- package/dist/existing-file.js +4 -0
- package/package.json +10 -12
package/dist/executable.js
CHANGED
|
@@ -16,6 +16,9 @@ async function executable(action) {
|
|
|
16
16
|
await fs_1.promises.access(fullPath, fs.constants.X_OK);
|
|
17
17
|
}
|
|
18
18
|
catch (err) {
|
|
19
|
+
if (!tr.isFsError(err)) {
|
|
20
|
+
throw err;
|
|
21
|
+
}
|
|
19
22
|
switch (err.code) {
|
|
20
23
|
case "EACCES":
|
|
21
24
|
throw new tr.UserError(`file is not executable: ${color.cyan(filePath)}`, "", action.location);
|
|
@@ -24,6 +24,9 @@ async function existingFileContent(action) {
|
|
|
24
24
|
actualContent = await fs_1.promises.readFile(fullPath, "utf8");
|
|
25
25
|
}
|
|
26
26
|
catch (err) {
|
|
27
|
+
if (!tr.isFsError(err)) {
|
|
28
|
+
throw err;
|
|
29
|
+
}
|
|
27
30
|
if (err.code === "ENOENT") {
|
|
28
31
|
throw new Error(`file not found: ${color.cyan(filePath)}`);
|
|
29
32
|
}
|
|
@@ -35,7 +38,7 @@ async function existingFileContent(action) {
|
|
|
35
38
|
assertNoDiff.trimmedLines(eol.lf(actualContent.trim()), eol.lf(expectedContent.trim()));
|
|
36
39
|
}
|
|
37
40
|
catch (err) {
|
|
38
|
-
throw new tr.UserError(`mismatching content in ${color.cyan(color.bold(filePath))}`, err
|
|
41
|
+
throw new tr.UserError(`mismatching content in ${color.cyan(color.bold(filePath))}`, tr.errorMessage(err));
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
exports.existingFileContent = existingFileContent;
|
package/dist/existing-file.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.existingFile = void 0;
|
|
4
4
|
const color = require("colorette");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
|
+
const tr = require("text-runner-core");
|
|
6
7
|
async function existingFile(action) {
|
|
7
8
|
const fileName = action.region.text();
|
|
8
9
|
action.name(`document mentions source code file ${color.cyan(fileName)}`);
|
|
@@ -12,6 +13,9 @@ async function existingFile(action) {
|
|
|
12
13
|
var stats = await fs_1.promises.stat(fullPath);
|
|
13
14
|
}
|
|
14
15
|
catch (err) {
|
|
16
|
+
if (!tr.isFsError(err)) {
|
|
17
|
+
throw err;
|
|
18
|
+
}
|
|
15
19
|
if (err.code === "ENOENT") {
|
|
16
20
|
throw new Error(`file not found: ${color.cyan(fileName)}`);
|
|
17
21
|
}
|
package/package.json
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "textrun-repo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Text-Runner actions for verifying the content of the current repository",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
5
|
"license": "ISC",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist/**/*.js"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"assert-no-diff": "3.0.
|
|
11
|
+
"assert-no-diff": "3.0.6",
|
|
12
|
+
"colorette": "2.0.19",
|
|
12
13
|
"eol": "0.9.1",
|
|
13
|
-
"text-runner-core": "5.0.
|
|
14
|
+
"text-runner-core": "^5.0.2"
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
|
-
"colorette": "1.2.1",
|
|
17
|
-
"cucumber": "6.0.5",
|
|
18
|
-
"mocha": "8.0.1",
|
|
19
17
|
"shared-cucumber-steps": "0.0.0",
|
|
20
|
-
"text-runner": "5.0.
|
|
21
|
-
"textrun-action": "0.
|
|
22
|
-
"textrun-extension": "0.
|
|
23
|
-
"textrun-npm": "0.
|
|
18
|
+
"text-runner": "^5.0.2",
|
|
19
|
+
"textrun-action": "^0.1.2",
|
|
20
|
+
"textrun-extension": "^0.1.2",
|
|
21
|
+
"textrun-npm": "^0.1.2"
|
|
24
22
|
},
|
|
25
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "1dca29620ef3189c64a62d706ded97c9b99deda3"
|
|
26
24
|
}
|