-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: check if installed command is really executable
- Loading branch information
Showing
34 changed files
with
3,269 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
curl -fsSL https://moonrepo.dev/install/proto.sh | PROTO_HOME=/usr/local bash -s -- --yes | ||
cd /workspace | ||
proto use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,3 +173,7 @@ dist | |
|
||
# Finder (MacOS) folder config | ||
.DS_Store | ||
|
||
# moon | ||
.moon/cache | ||
.moon/docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
$schema: https://moonrepo.dev/schemas/tasks.json | ||
|
||
tasks: | ||
test: | ||
command: vitest --run --pool=forks --passWithNoTests | ||
inputs: | ||
- "**/*.ts" | ||
platform: node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# https://moonrepo.dev/docs/config/toolchain | ||
$schema: https://moonrepo.dev/schemas/toolchain.json | ||
|
||
node: | ||
# The version to use. Must be a semantic version that includes major, minor, and patch. | ||
# We suggest using the latest active LTS version: https://nodejs.org/en/about/releases | ||
# version: '20.0.0' | ||
|
||
# The package manager to use when managing dependencies. | ||
# Accepts "npm" (default), "pnpm", "yarn", or "bun". | ||
packageManager: yarn | ||
|
||
# The version of the package manager (above) to use. | ||
yarn: | ||
version: 4.2.2 | ||
installArgs: | ||
- --immutable | ||
|
||
# Add `node.version` as a constraint in the root `package.json` `engines`. | ||
addEnginesConstraint: true | ||
|
||
# Dedupe dependencies after the lockfile has changed. | ||
dedupeOnLockfileChange: true | ||
|
||
# Version format to use when syncing dependencies within the project's `package.json`. | ||
# dependencyVersionFormat: 'workspace' | ||
|
||
# Infer and automatically create moon tasks from `package.json` scripts, per project. | ||
# BEWARE: Tasks and scripts are not 1:1 in functionality, so please refer to the documentation. | ||
inferTasksFromScripts: false | ||
|
||
# Support the "one version policy" by only declaring dependencies in the root `package.json`. | ||
# rootPackageOnly: true | ||
|
||
# Sync a project's relationships as `dependencies` within the project's `package.json`. | ||
syncProjectWorkspaceDependencies: true | ||
|
||
# Sync `node.version` to a 3rd-party version manager's config file. | ||
# Accepts "nodenv" (.node-version), "nvm" (.nvmrc), or none. | ||
# syncVersionManagerConfig: 'nvm' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
$schema: https://moonrepo.dev/schemas/workspace.json | ||
|
||
projects: | ||
- "*" | ||
- "!.*" | ||
|
||
vcs: | ||
manager: git | ||
defaultBranch: main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
bun = "1.1.15" | ||
moon = "1.25.6" | ||
node = "22.3.0" | ||
|
||
[plugins] | ||
moon = "https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
yarnPath: .yarn/releases/yarn-4.2.2.cjs | ||
|
||
nodeLinker: node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "argo", | ||
afterInstall: async ($) => { | ||
await $`argo version`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "argocd", | ||
afterInstall: async ($) => { | ||
await $`argocd version --client`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "black", | ||
afterInstall: async ($) => { | ||
await $`black --version`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "cue", | ||
afterInstall: async ($) => { | ||
await $`cue version`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "fzf", | ||
afterInstall: async ($) => { | ||
await $`fzf --version`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "gh", | ||
afterInstall: async ($) => { | ||
await $`gh --version`; | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "jnv", | ||
afterInstall: async ($) => { | ||
await $`jnv --version`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "jq", | ||
afterInstall: async ($) => { | ||
await $`jq --version`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "k3d", | ||
afterInstall: async ($) => { | ||
await $`k3d --version`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "k6", | ||
afterInstall: async ($) => { | ||
await $`k6 --version`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "k9s", | ||
afterInstall: async ($) => { | ||
await $`k9s version`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "mise", | ||
afterInstall: async ($) => { | ||
await $`mise --version`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
{ | ||
"name": "proto-toml-plugin", | ||
"type": "module", | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.8.1", | ||
"@types/bun": "latest" | ||
}, | ||
"peerDependencies": { | ||
"typescript": "^5.0.0" | ||
} | ||
"name": "proto-toml-plugin", | ||
"type": "module", | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.8.1", | ||
"@tsconfig/node22": "^22.0.0", | ||
"@tsconfig/strictest": "^2.0.5", | ||
"@types/node": "^20.14.6", | ||
"typescript": "^5.4.5", | ||
"vitest": "^1.6.0" | ||
}, | ||
"peerDependencies": { | ||
"typescript": "^5.0.0" | ||
}, | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
"node": "22.3.0" | ||
}, | ||
"dependencies": { | ||
"toml": "^3.0.0", | ||
"zx": "^8.1.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "rye", | ||
afterInstall: async ($) => { | ||
await $`rye --version`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "sccache", | ||
afterInstall: async ($) => { | ||
await $`sccache --version`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "stern", | ||
afterInstall: async ($) => { | ||
await $`stern --version`; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// biome-ignore lint/nursery/noRestrictedImports: <explanation> | ||
import { readFileSync } from "node:fs"; | ||
import { mkdtemp } from "node:fs/promises"; | ||
import { tmpdir } from "node:os"; | ||
import { join as pathJoin } from "node:path"; | ||
import toml from "toml"; | ||
import { test } from "vitest"; | ||
import { $ as $$, type Shell, cd } from "zx/core"; | ||
|
||
export function run({ | ||
name, | ||
afterInstall, | ||
}: { | ||
name: string; | ||
afterInstall?: ($: Shell) => Promise<void>; | ||
}) { | ||
const tomlPath = pathJoin(import.meta.dirname, name, "plugin.toml"); | ||
const content = readFileSync(tomlPath, { encoding: "utf-8" }); | ||
const data = toml.parse(content) as Plugin; | ||
const platform = getPlatform(); | ||
const supportPlatforms = Object.keys(data.platform); | ||
const skip = !supportPlatforms.includes(platform); | ||
console.log(`[${name}] supports: [${supportPlatforms}], current: ${platform}, skip: ${skip}`); | ||
const $ = $$({ verbose: true }); | ||
|
||
test.skipIf(skip)(`proto install ${name}`, { timeout: Number.POSITIVE_INFINITY }, async () => { | ||
const dir = await mkdtemp(`${tmpdir()}/proto-plugin-test-${name}`); | ||
cd(dir); | ||
await $`pwd`; | ||
await $`proto plugin add ${name} source:${tomlPath}`; | ||
await $`proto install ${name} latest`; | ||
if (afterInstall) { | ||
await afterInstall($); | ||
} | ||
}); | ||
} | ||
|
||
type Plugin = { | ||
name: string; | ||
platform: Partial<Record<"linux" | "macos" | "windows", object>>; | ||
}; | ||
|
||
function getPlatform(): "linux" | "macos" | "windows" | "unknown" { | ||
return process.platform === "linux" | ||
? "linux" | ||
: process.platform === "darwin" | ||
? "macos" | ||
: process.platform === "win32" | ||
? "windows" | ||
: "unknown"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { run } from "../testkit.js"; | ||
|
||
run({ | ||
name: "tilt", | ||
afterInstall: async ($) => { | ||
await $`tilt version`; | ||
}, | ||
}); |
Oops, something went wrong.