Skip to content

Commit

Permalink
fix: update formVersionWriter to add semicolon and new line at end fo…
Browse files Browse the repository at this point in the history
…r lint
  • Loading branch information
chrisfalaska authored and chrisfalaska committed Dec 4, 2024
1 parent 47b86c7 commit 1c3fb47
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/build-tools/src/formVersionWriter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@ export function writeDepVersionFile(pkg) {
const elemSubName = pkg.substring(pkg.indexOf('auro-') + auroSubNameIndex);

const callerPath = fileURLToPath(import.meta.url);

const pathParts = callerPath.split('/');
const componentsIndex = pathParts.indexOf('components');
const componentName = componentsIndex !== -1 ? pathParts[componentsIndex + 1] : null;

const basePath = componentName
const basePath = componentName
? `components/${componentName}/src`
: 'src';

const versionFilePath = `./${basePath}/${elemSubName}Version.js`;

console.log(`Writing version file to: ${versionFilePath}`);

const directory = dirname(versionFilePath);
Expand All @@ -36,8 +34,11 @@ export function writeDepVersionFile(pkg) {
if (err) throw err;
});
}

// Add semicolon and newline to the end of the content
const fileContent = `export default '${version}';\n`;

writeFile(versionFilePath, `export default '${version}'`, (err) => {
writeFile(versionFilePath, fileContent, (err) => {
if (err) {
console.error(`Error writing file: ${err.message}`);
throw err;
Expand Down

0 comments on commit 1c3fb47

Please sign in to comment.