125
hashParts.push(`${hashKey}:${content.value.toString()}`);
126
}
128
>
if (token.isCancellationRequested) {
129
return undefined;
130
}
132
>
hashParts.sort();
133
>
const nonce = String(hash(hashParts.join('\n')));
134
>
135
>
const rootUriString = this._rootUri.toString() as ProtocolURI;
136
>
const result = {
137
>
ref: {
138
>
type: CustomizationType.Plugin,
139
>
id: customizationId(rootUriString),
140
>
uri: rootUriString,
141
>
name: DISPLAY_NAME,
142
>
enabled: true,
143
>
nonce,
144
>
},
145
>
} satisfies IBundleResult;
146
>
147
>
if (this._lastNonce === nonce) {
148
return result;
149
}
151
>
try {
152
>
await this._fileService.del(this._rootUri, { recursive: true });
153
>
} catch {
154
>
// Directory may not exist on first bundle.
155
>
}
156
>
if (token.isCancellationRequested) {
157
return undefined;
158
}
160
>
const manifestUri = URI.joinPath(this._rootUri, '.plugin', 'plugin.json');
161
>
await this._fileService.createFolder(dirname(manifestUri));
162
>
if (token.isCancellationRequested) {
163
return undefined;
164
}
165
>
await this._fileService.writeFile(manifestUri, VSBuffer.fromString(MANIFEST_CONTENT));
sessionPluginBundler.ts
166
>
if (token.isCancellationRequested) {
167
return undefined;
168
}
170
>
for (const file of files) {
171
await this._fileService.createFolder(dirname(file.destUri));
172
if (token.isCancellationRequested) {