MCPcopy
hub / github.com/VSCodeVim/Vim / updatePath

Function updatePath

gulpfile.js:51–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49}
50
51function updatePath() {
52 const input = es.through();
53 const output = input.pipe(
54 es.mapSync((f) => {
55 const contents = f.contents.toString('utf8');
56 const filePath = f.path;
57 let platformRelativepath = path.relative(
58 path.dirname(filePath),
59 path.resolve(process.cwd(), 'out/src/platform/node'),
60 );
61 platformRelativepath = platformRelativepath.replace(/\\/g, '/');
62 f.contents = Buffer.from(
63 contents.replace(
64 /\(\"platform\/([^"]*)\"\)/g,
65 '("' + (platformRelativepath === '' ? './' : platformRelativepath + '/') + '$1")',
66 ),
67 'utf8',
68 );
69 return f;
70 }),
71 );
72 return es.duplex(input, output);
73}
74
75function copyPackageJson() {
76 return gulp.src('./package.json').pipe(gulp.dest('out'));

Callers 1

gulpfile.jsFile · 0.85

Calls 5

relativeMethod · 0.80
dirnameMethod · 0.80
toStringMethod · 0.65
resolveMethod · 0.65
replaceMethod · 0.45

Tested by

no test coverage detected