MCPcopy
hub / github.com/mozilla/web-ext / create

Method create

src/util/temp-dir.js:68–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66 * been created.
67 */
68 create() {
69 return createTempDir({
70 prefix: 'tmp-web-ext-',
71 // This allows us to remove a non-empty tmp dir.
72 unsafeCleanup: true,
73 }).then(([tmpPath, removeTempDir]) => {
74 this._path = tmpPath;
75 this._removeTempDir = () =>
76 new Promise((resolve, reject) => {
77 // `removeTempDir` parameter is a `next` callback which
78 // is called once the dir has been removed.
79 const next = (err) => (err ? reject(err) : resolve());
80 removeTempDir(next);
81 });
82 log.debug(`Created temporary directory: ${this.path()}`);
83 return this;
84 });
85 }
86
87 /*
88 * Get the absolute path of the temp directory.

Callers 5

setupInstanceMethod · 0.95
withTempDirFunction · 0.95
connectMethod · 0.80
test.temp-dir.jsFile · 0.80
background.jsFile · 0.80

Calls 1

pathMethod · 0.95

Tested by

no test coverage detected