myskillshub 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/publish.js +14 -6
package/package.json
CHANGED
package/src/commands/publish.js
CHANGED
|
@@ -118,7 +118,8 @@ function parseSkillMd(content) {
|
|
|
118
118
|
|
|
119
119
|
function createZipPackage(directory) {
|
|
120
120
|
return new Promise((resolve, reject) => {
|
|
121
|
-
const
|
|
121
|
+
const baseName = path.basename(path.resolve(directory));
|
|
122
|
+
const zipPath = path.join(process.cwd(), `${baseName}-package-${Date.now()}.zip`);
|
|
122
123
|
const output = createWriteStream(zipPath);
|
|
123
124
|
const archive = archiver('zip', {
|
|
124
125
|
zlib: { level: 9 }
|
|
@@ -131,14 +132,21 @@ function createZipPackage(directory) {
|
|
|
131
132
|
output.on('error', (err) => {
|
|
132
133
|
reject(err);
|
|
133
134
|
});
|
|
135
|
+
archive.on('error', (err) => {
|
|
136
|
+
reject(err);
|
|
137
|
+
});
|
|
134
138
|
|
|
135
139
|
archive.pipe(output);
|
|
136
140
|
|
|
137
|
-
// Add all files
|
|
138
|
-
archive.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
// Add all files recursively, excluding typical VCS/dependency artifacts.
|
|
142
|
+
archive.glob('**/*', {
|
|
143
|
+
cwd: directory,
|
|
144
|
+
dot: true,
|
|
145
|
+
ignore: [
|
|
146
|
+
'**/node_modules/**',
|
|
147
|
+
'**/.git/**',
|
|
148
|
+
'**/.DS_Store'
|
|
149
|
+
]
|
|
142
150
|
});
|
|
143
151
|
|
|
144
152
|
archive.finalize();
|