MCPcopy Index your code
hub / github.com/isomorphic-git/isomorphic-git / write

Method write

src/models/FileSystem.js:147–155  ·  view source on GitHub ↗

* Write a file (creating missing directories if need be) without throwing errors. * * @param {string} filepath - The path to the file. * @param {Buffer|Uint8Array|string} contents - The data to write. * @param {Object|string} [options] - Options for writing the file. * @returns {Promi

(filepath, contents, options = {})

Source from the content-addressed store, hash-verified

145 * @returns {Promise<void>}
146 */
147 async write(filepath, contents, options = {}) {
148 try {
149 await this._writeFile(filepath, contents, options)
150 } catch (err) {
151 // Hmm. Let's try mkdirp and try again.
152 await this.mkdir(dirname(filepath))
153 await this._writeFile(filepath, contents, options)
154 }
155 }
156
157 /**
158 * Make a directory (or series of nested directories) without throwing an error if it already exists.

Callers 2

abortMergeFunction · 0.95
nextBitMethod · 0.45

Calls 2

mkdirMethod · 0.95
dirnameFunction · 0.90

Tested by

no test coverage detected