Skip to content

Commit

Permalink
debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
isnbh0 committed Dec 1, 2024
1 parent 0798aad commit a5e4066
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions scripts/publish-chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,40 @@ async function publishExtension(accessToken) {

// Main publishing process
async function publishChromeExtension() {
console.log('πŸ” Starting publishChromeExtension process');

// Path to the zipped extension package
const zipFilePath = path.join(__dirname, '../dist/extension.zip'); // Update this path as needed
console.log(`πŸ“‚ Zip file path: ${zipFilePath}`);

// Check if the zip file exists
if (!fs.existsSync(zipFilePath)) {
console.error(`❌ Extension package not found at path: ${zipFilePath}`);
process.exit(1);
}
console.log('βœ… Extension package exists.');

try {
// Refresh access token
console.log('πŸ”„ Refreshing access token...');
const accessToken = await refreshAccessToken();
console.log(`πŸ”‘ Access token obtained: ${accessToken}`);

// Refresh access token
const accessToken = await refreshAccessToken();
// Upload the extension package
console.log('πŸ“¦ Uploading extension package...');
await uploadExtension(accessToken, zipFilePath);
console.log('βœ… Extension package uploaded successfully.');

// Upload the extension package
await uploadExtension(accessToken, zipFilePath);
// Publish the extension
console.log('πŸš€ Publishing the extension to Chrome Web Store...');
await publishExtension(accessToken);
console.log('βœ… Extension published successfully.');
} catch (error) {
console.error(`❌ An error occurred during the publishing process: ${error.message}`);
process.exit(1);
}

// Publish the extension
await publishExtension(accessToken);
console.log('πŸŽ‰ publishChromeExtension process completed.');
}

// Execute the publishing process
Expand Down

0 comments on commit a5e4066

Please sign in to comment.