Skip to content

Commit fcc75a4

Browse files
stop overwriting sources
1 parent fd743df commit fcc75a4

File tree

3 files changed

+5
-37
lines changed

3 files changed

+5
-37
lines changed

dist/index.js

Lines changed: 1 addition & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,7 @@ const modifyManifest = (manifest, manifestPath, runTests = false) => {
8888
}
8989
const module = manifest["modules"].slice(-1)[0]
9090
module["run-tests"] = runTests
91-
module["sources"] = module.sources.map((source) => {
92-
if (source.type === "git") {
93-
return {
94-
type: "dir",
95-
path: path.relative(path.dirname(manifestPath), "."),
96-
}
97-
}
98-
return source
99-
})
91+
10092
return manifest
10193
}
10294

tests/parser.test.js

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const path = require("path")
21
const { parseManifest, modifyManifest } = require("../index")
32

43
test("The manifest should be parsed correctly", async () => {
@@ -35,12 +34,7 @@ test("The manifest should be modified correctly if tests are enabled", async ()
3534
const lastModule = modifiedManifest["modules"].slice(-1)[0]
3635
expect(lastModule.name).toBe("testproject")
3736
expect(lastModule["run-tests"]).toBe(true)
38-
expect(lastModule.sources).toEqual([
39-
{
40-
type: "dir",
41-
path: "..",
42-
},
43-
])
37+
4438
})
4539

4640
test("The manifest should be modified correctly if tests are enabled & has a build-options", async () => {
@@ -64,12 +58,7 @@ test("The manifest should be modified correctly if tests are enabled & has a bui
6458
const lastModule = modifiedManifest["modules"].slice(-1)[0]
6559
expect(lastModule.name).toBe("contrast")
6660
expect(lastModule["run-tests"]).toBe(true)
67-
expect(lastModule.sources).toEqual([
68-
{
69-
type: "dir",
70-
path: "..",
71-
},
72-
])
61+
7362
})
7463

7564
test("The manifest should be modified correctly if in a subdirectory", async () => {
@@ -81,10 +70,5 @@ test("The manifest should be modified correctly if in a subdirectory", async ()
8170
const lastModule = modifiedManifest["modules"].slice(-1)[0]
8271
expect(lastModule.name).toBe("testproject")
8372
expect(lastModule["run-tests"]).toBe(false)
84-
expect(lastModule.sources).toEqual([
85-
{
86-
type: "dir",
87-
path: "../..",
88-
},
89-
])
73+
9074
})

0 commit comments

Comments
 (0)