Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #65

Merged
merged 2 commits into from
Mar 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,8 @@ async function init() {
}
}

init().catch(errorHandler);
try {
await init();
} catch (error) {
errorHandler(error);
}
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
"object-curly-spacing": [
"error",
"always"
],
"camelcase": "off",
"unicorn/no-process-exit": "off"
]
},
"space": 4
"space": 4,
"ignore": [
"test/fixtures"
]
},
"ava": {
"files": [
Expand All @@ -45,18 +46,18 @@
]
},
"dependencies": {
"chrome-webstore-upload": "^0.5.0",
"chrome-webstore-upload": "^1.0.0",
"junk": "^4.0.0",
"meow": "^10.1.1",
"ora": "^6.0.1",
"recursive-readdir": "^2.2.2",
"meow": "^11.0.0",
"ora": "^6.1.2",
"recursive-readdir": "^2.2.3",
"yazl": "^2.5.1"
},
"devDependencies": {
"ava": "^3.15.0",
"execa": "^5.1.1",
"ava": "^5.2.0",
"execa": "^7.0.0",
"is-stream": "^3.0.0",
"xo": "^0.44.0"
"xo": "^0.53.1"
},
"engines": {
"node": "^14.13.1 || >=16.0.0"
Expand Down
2 changes: 1 addition & 1 deletion test/cli.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test from 'ava';
import execa from 'execa';
import { execa } from 'execa';

function env(vars = {}) {
return {
Expand Down
18 changes: 4 additions & 14 deletions wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,11 @@ import zipdir from './zipdir.js';
const isZip = filepath => path.extname(filepath) === '.zip';

export async function upload({ apiConfig, zipPath, token }) {
let client;
try {
client = getClient(apiConfig);
} catch (error) {
return Promise.reject(error);
}

const client = getClient(apiConfig);
const fullPath = path.join(process.cwd(), zipPath);

if (isZip(fullPath)) {
const zipStream = fs.createReadStream(fullPath);
return client.uploadExisting(zipStream, token);
}

const zipStream = await zipdir(zipPath);
const zipStream = isZip(fullPath)
? fs.createReadStream(fullPath)
: await zipdir(zipPath);
return client.uploadExisting(zipStream, token);
}

Expand Down