Skip to content

Commit

Permalink
cleanup: codestyle changes
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Kotzbauer <[email protected]>
  • Loading branch information
ckotzbauer committed Mar 20, 2022
1 parent 5fce67f commit 45236bd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
1 change: 0 additions & 1 deletion src/kyverno-cli-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const stableKyvernoVersion = "v1.4.3";
const latestKyvernoVersion = "1.*";
const kyvernoAllReleasesUrl = "https://api.github.com/repos/kyverno/kyverno/releases";


export function getExecutableExtension(): string {
if (osType().match(/^Win/)) {
return ".exe";
Expand Down
3 changes: 1 addition & 2 deletions src/resource-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { loadAll, dump } from "js-yaml";
import { Resource } from "./types";

export const fetchResources = async function (): Promise<Resource[]> {
const resourceFiles = core
.getInput("resource-files", { required: false });
const resourceFiles = core.getInput("resource-files", { required: false });
await io.mkdirP("/tmp/kyverno-test");
const resourceContents: string[] = [];
let resources: Resource[] = [];
Expand Down
44 changes: 24 additions & 20 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,38 @@ import * as fs from "fs";
import * as os from "os";

export function osType(): string {
return os.type();
return os.type();
}

export function readFileSync(path: fs.PathOrFileDescriptor,
options:
| {
encoding: BufferEncoding;
flag?: string | undefined;
}
| BufferEncoding): string {
return fs.readFileSync(path, options);
export function readFileSync(
path: fs.PathOrFileDescriptor,
options:
| {
encoding: BufferEncoding;
flag?: string | undefined;
}
| BufferEncoding
): string {
return fs.readFileSync(path, options);
}

export function chmodSync(path: fs.PathLike, mode: fs.Mode): void {
fs.chmodSync(path, mode);
fs.chmodSync(path, mode);
}

export function readdirSync(path: fs.PathLike,
options?:
| {
encoding: BufferEncoding | null;
withFileTypes?: false | undefined;
}
| BufferEncoding
| null): string[] {
return fs.readdirSync(path, options);
export function readdirSync(
path: fs.PathLike,
options?:
| {
encoding: BufferEncoding | null;
withFileTypes?: false | undefined;
}
| BufferEncoding
| null
): string[] {
return fs.readdirSync(path, options);
}

export function statSync(path: fs.PathLike, options?: undefined): fs.Stats {
return fs.statSync(path, options);
return fs.statSync(path, options);
}

0 comments on commit 45236bd

Please sign in to comment.