Skip to content

Commit ca718f0

Browse files
committed
chore: revert to prettier default settings
1 parent a7f9749 commit ca718f0

File tree

2 files changed

+38
-32
lines changed

2 files changed

+38
-32
lines changed

.prettierrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

cli.js

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,42 @@ const tempDir = os.tmpdir() + `/${packageName}-staging`;
1212
const elapsed = require("elapsed-time-logger");
1313

1414
module.exports = async () => {
15-
const argv = yargs_parser(process.argv.slice(2), {
16-
alias: { release: ["r"] },
17-
});
18-
const timer = elapsed.start();
19-
const version = argv["release"] || "latest";
20-
const targetDir = path.resolve(argv["_"][0] || "./");
21-
const spinner = ora(`Downloading ${packageName} version '${version}' to ${targetDir}`).start();
22-
await fs.ensureDir(tempDir);
23-
try {
24-
const { from: nameWithVersion } = await extract(packageName + "@" + version, tempDir, {});
25-
spinner.text = `${nameWithVersion} copied to ${targetDir} in ${timer.get()}. Have fun!`;
26-
} catch (err) {
27-
await fs.remove(tempDir);
28-
if (err.code === "ETARGET") {
29-
spinner.fail(chalk.red(`version '${err.wanted}' not found in npm registry\navailable versions:`));
30-
console.log(err.versions.reverse().join(" | "));
31-
process.exit(1);
32-
} /* istanbul ignore next */ else {
33-
spinner.fail("Unexpected error");
34-
console.error(err);
35-
process.exit(-1);
36-
}
37-
return;
38-
}
39-
await fs.copy(tempDir + "/dist", targetDir);
40-
await fs.remove(tempDir);
41-
spinner.succeed();
42-
return;
15+
const argv = yargs_parser(process.argv.slice(2), {
16+
alias: { release: ["r"] },
17+
});
18+
const timer = elapsed.start();
19+
const version = argv["release"] || "latest";
20+
const targetDir = path.resolve(argv["_"][0] || "./");
21+
const spinner = ora(
22+
`Downloading ${packageName} version '${version}' to ${targetDir}`
23+
).start();
24+
await fs.ensureDir(tempDir);
25+
try {
26+
const { from: nameWithVersion } = await extract(
27+
packageName + "@" + version,
28+
tempDir,
29+
{}
30+
);
31+
spinner.text = `${nameWithVersion} copied to ${targetDir} in ${timer.get()}. Have fun!`;
32+
} catch (err) {
33+
await fs.remove(tempDir);
34+
if (err.code === "ETARGET") {
35+
spinner.fail(
36+
chalk.red(
37+
`version '${err.wanted}' not found in npm registry\navailable versions:`
38+
)
39+
);
40+
console.log(err.versions.reverse().join(" | "));
41+
process.exit(1);
42+
} /* istanbul ignore next */ else {
43+
spinner.fail("Unexpected error");
44+
console.error(err);
45+
process.exit(-1);
46+
}
47+
return;
48+
}
49+
await fs.copy(tempDir + "/dist", targetDir);
50+
await fs.remove(tempDir);
51+
spinner.succeed();
52+
return;
4353
};

0 commit comments

Comments
 (0)