-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.ps1
More file actions
102 lines (81 loc) · 3.11 KB
/
Copy pathpackage.ps1
File metadata and controls
102 lines (81 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Script to package the Chrome extension for distribution
Write-Host "Packaging BigCommerce WYSIWYG Editor v4.3..." -ForegroundColor Cyan
$zipFileName = "bigcommerce-wysiwyg-editor-v4.3.zip"
# Remove existing zip if it exists
if (Test-Path $zipFileName) {
Remove-Item $zipFileName -Force
Write-Host "Previous zip file removed." -ForegroundColor Yellow
}
# Define files to include in the package
$filesToInclude = @(
"manifest.json",
"content.js",
"popup.js",
"popup.html",
"background.js",
"README.md",
"PRIVACY_POLICY.md",
"img/icon16.png",
"img/icon48.png",
"img/icon128.png"
)
# Verify that all files exist
$allFilesExist = $true
foreach ($file in $filesToInclude) {
if (-not (Test-Path $file)) {
Write-Host "Warning! File not found: $file" -ForegroundColor Red
$allFilesExist = $false
}
}
if (-not $allFilesExist) {
Write-Host "Some required files are missing. Please check the file list." -ForegroundColor Red
exit 1
}
# Create temporary directory for packaging
$tempDir = ".\temp_package"
if (Test-Path $tempDir) {
Remove-Item -Recurse -Force $tempDir
}
New-Item -ItemType Directory -Path $tempDir | Out-Null
# Copy files to temporary directory
foreach ($file in $filesToInclude) {
$destFile = Join-Path -Path $tempDir -ChildPath $file
$destDir = Split-Path -Path $destFile -Parent
if (-not (Test-Path $destDir)) {
New-Item -ItemType Directory -Path $destDir | Out-Null
}
Copy-Item -Path $file -Destination $destFile
Write-Host "Copied: $file" -ForegroundColor Green
}
# Compress files
try {
Add-Type -AssemblyName System.IO.Compression.FileSystem
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal
[System.IO.Compression.ZipFile]::CreateFromDirectory($tempDir, $zipFileName, $compressionLevel, $false)
Write-Host "Package created: $zipFileName" -ForegroundColor Green
$fileSize = (Get-Item $zipFileName).Length / 1KB
Write-Host "Size: $([Math]::Round($fileSize, 2)) KB" -ForegroundColor Cyan
# Clean up temporary directory
Remove-Item -Recurse -Force $tempDir
} catch {
Write-Host "Error creating package: $_" -ForegroundColor Red
}
Write-Host @"
=================================
NEXT STEPS FOR PUBLICATION:
=================================
1. Log in to the Chrome Web Store Developer Dashboard:
https://chrome.google.com/webstore/devconsole/
2. Click "Add new item" and upload the generated zip file.
3. Complete the following details:
- Name: BigCommerce WYSIWYG Editor
- Brief description: Lightweight HTML editor for text fields in BigCommerce
- Detailed description: [See README.md]
- Screenshots: Add at least 1-3 screenshots of 1280x800px
- Promotion: Add a promotional image of 440x280px (optional)
- Category: Developer Tools
- Languages: Spanish, English
- Privacy policy: Use the PRIVACY_POLICY.md file
4. Price and distribution: Configure where the extension will be available.
5. Submit for review.
"@ -ForegroundColor Yellow