forked from Mirror/attic-action
add prettier config
This commit is contained in:
parent
5f106d5966
commit
16bd754a82
7 changed files with 75 additions and 79 deletions
4
.prettierrc
Normal file
4
.prettierrc
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"useTabs": true,
|
||||||
|
"printWidth": 120
|
||||||
|
}
|
|
@ -11,7 +11,7 @@ export const install = async () => {
|
||||||
|
|
||||||
core.info("Installing attic");
|
core.info("Installing attic");
|
||||||
const installScript = await fetch(
|
const installScript = await fetch(
|
||||||
"https://raw.githubusercontent.com/zhaofengli/attic/main/.github/install-attic-ci.sh"
|
"https://raw.githubusercontent.com/zhaofengli/attic/main/.github/install-attic-ci.sh",
|
||||||
).then((r) => {
|
).then((r) => {
|
||||||
if (!r.ok) {
|
if (!r.ok) {
|
||||||
core.setFailed(`Action failed with error: ${r.statusText}`);
|
core.setFailed(`Action failed with error: ${r.statusText}`);
|
||||||
|
|
|
@ -18,11 +18,7 @@ export const push = async () => {
|
||||||
const addedPaths = newPaths
|
const addedPaths = newPaths
|
||||||
.filter((p) => !oldPaths.includes(p))
|
.filter((p) => !oldPaths.includes(p))
|
||||||
.filter(
|
.filter(
|
||||||
(p) =>
|
(p) => !p.endsWith(".drv") && !p.endsWith(".drv.chroot") && !p.endsWith(".check") && !p.endsWith(".lock"),
|
||||||
!p.endsWith(".drv") &&
|
|
||||||
!p.endsWith(".drv.chroot") &&
|
|
||||||
!p.endsWith(".check") &&
|
|
||||||
!p.endsWith(".lock")
|
|
||||||
);
|
);
|
||||||
|
|
||||||
await exec("attic", ["push", cache, ...addedPaths]);
|
await exec("attic", ["push", cache, ...addedPaths]);
|
||||||
|
|
|
@ -4,11 +4,7 @@ import { Writable } from "node:stream";
|
||||||
class StringStream extends Writable {
|
class StringStream extends Writable {
|
||||||
chunks: Buffer[] = [];
|
chunks: Buffer[] = [];
|
||||||
|
|
||||||
_write(
|
_write(chunk: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>, _enc: unknown, next: () => unknown) {
|
||||||
chunk: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
|
|
||||||
_enc: unknown,
|
|
||||||
next: () => unknown
|
|
||||||
) {
|
|
||||||
this.chunks.push(Buffer.from(chunk));
|
this.chunks.push(Buffer.from(chunk));
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue