fix: replace fs-extra.ensureFileSync with fs.writeFileSync (#1790)

This commit is contained in:
エリス 2025-03-22 00:45:00 +09:00 committed by GitHub
parent 839f9b878b
commit f6e384a9ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -298,13 +298,13 @@ class ProjectBuilder {
return self.prepBuildFiles();
}).then(() => {
const signingPropertiesPath = path.join(self.root, `${opts.buildType}${SIGNING_PROPERTIES}`);
if (fs.existsSync(signingPropertiesPath)) fs.rmSync(signingPropertiesPath);
if (opts.packageInfo) {
fs.ensureFileSync(signingPropertiesPath);
fs.writeFileSync(signingPropertiesPath, '', 'utf8');
const signingProperties = createEditor(signingPropertiesPath);
signingProperties.addHeadComment(TEMPLATE);
opts.packageInfo.appendToProperties(signingProperties);
} else {
fs.rmSync(signingPropertiesPath, { force: true });
}
});
}