chrome-webstore-upload-cli
Version:
CLI tool to upload Chrome Extensions to the Chrome Web Store
30 lines (23 loc) • 655 B
JavaScript
import { relative, extname } from 'node:path';
export function isArchive(filepath) {
const ext = extname(filepath);
return ext === '.zip' || ext === '.crx';
}
export function isUploadSuccess(response) {
return response.uploadState === 'SUCCESS';
}
export function handlePublishStatus(item) {
const [firstStatus] = item.status;
if (firstStatus === 'OK') {
console.log('Publish successful');
return;
}
if (firstStatus === 'ITEM_PENDING_REVIEW') {
console.log('Publish pending review');
return;
}
throw item;
}
export function zipPath(root, file) {
return relative(root, file);
}