MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / appendFile

Method appendFile

tools/mcmanifest.js:1969–1988  ·  view source on GitHub ↗
(files, target, source, include)

Source from the content-addressed store, hash-verified

1967 this.tool = tool;
1968 }
1969 appendFile(files, target, source, include) {
1970 this.count++;
1971 source = this.tool.resolveFilePath(source);
1972 if (!files.already[source]) {
1973 files.already[source] = true;
1974 if (include) {
1975 let result = files.find(file => file.target == target);
1976 if (!result) {
1977 //this.tool.report(target + " " + source);
1978 let result = { target, source };
1979 files.push(result);
1980 return result;
1981 }
1982 if (result.sources)
1983 result.sources.push(source);
1984 else
1985 result.sources = [source];
1986 }
1987 }
1988 }
1989 appendFolder(folders, folder) {
1990 this.count++;
1991 if (!folders.already[folder]) {

Callers 10

appendSourceMethod · 0.45
appendSourceMethod · 0.45
appendSourceMethod · 0.45
appendBitmapMethod · 0.45
appendFontMethod · 0.45
appendImageMethod · 0.45
appendOutlineFontMethod · 0.45
appendSoundMethod · 0.45
appendPIOMethod · 0.45
appendSourceMethod · 0.45

Calls 3

resolveFilePathMethod · 0.80
findMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected