MCPcopy Create free account
hub / github.com/di-sukharev/opencommit / createFileFromPath

Function createFileFromPath

out/cli.cjs:14774–14789  ·  view source on GitHub ↗
(path5, { mtimeMs, size }, filenameOrOptions, options = {})

Source from the content-addressed store, hash-verified

14772 isFile: () => isFile
14773});
14774function createFileFromPath(path5, { mtimeMs, size }, filenameOrOptions, options = {}) {
14775 let filename;
14776 if (isPlainObject_default2(filenameOrOptions)) {
14777 [options, filename] = [filenameOrOptions, void 0];
14778 } else {
14779 filename = filenameOrOptions;
14780 }
14781 const file = new FileFromPath({ path: path5, size, lastModified: mtimeMs });
14782 if (!filename) {
14783 filename = file.name;
14784 }
14785 return new File3([file], filename, {
14786 ...options,
14787 lastModified: file.lastModified
14788 });
14789}
14790function fileFromPathSync(path5, filenameOrOptions, options = {}) {
14791 const stats = (0, import_fs2.statSync)(path5);
14792 return createFileFromPath(path5, stats, filenameOrOptions, options);

Callers 2

fileFromPathSyncFunction · 0.85
fileFromPath2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected