mirror of
https://github.com/sst/opencode.git
synced 2025-08-31 10:17:26 +00:00
hooks
This commit is contained in:
parent
8619c50976
commit
3862184ccb
4 changed files with 17 additions and 6 deletions
|
@ -5,7 +5,8 @@
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"packageManager": "bun@1.2.14",
|
"packageManager": "bun@1.2.14",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"typecheck": "bun run --filter='*' typecheck"
|
"typecheck": "bun run --filter='*' typecheck",
|
||||||
|
"postinstall": "./scripts/hooks"
|
||||||
},
|
},
|
||||||
"workspaces": {
|
"workspaces": {
|
||||||
"packages": [
|
"packages": [
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import z from "zod"
|
import z from "zod"
|
||||||
import path from "path"
|
|
||||||
import { App } from "../app/app"
|
import { App } from "../app/app"
|
||||||
import { Config } from "../config/config"
|
import { Config } from "../config/config"
|
||||||
import { mergeDeep, sortBy } from "remeda"
|
import { mergeDeep, sortBy } from "remeda"
|
||||||
|
@ -24,7 +23,6 @@ import { ModelsDev } from "./models"
|
||||||
import { NamedError } from "../util/error"
|
import { NamedError } from "../util/error"
|
||||||
import { Auth } from "../auth"
|
import { Auth } from "../auth"
|
||||||
import { TaskTool } from "../tool/task"
|
import { TaskTool } from "../tool/task"
|
||||||
import { Global } from "../global"
|
|
||||||
|
|
||||||
export namespace Provider {
|
export namespace Provider {
|
||||||
const log = Log.create({ service: "provider" })
|
const log = Log.create({ service: "provider" })
|
||||||
|
|
15
scripts/hooks
Executable file
15
scripts/hooks
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ ! -d ".git" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p .git/hooks
|
||||||
|
|
||||||
|
cat > .git/hooks/pre-push << 'EOF'
|
||||||
|
#!/bin/sh
|
||||||
|
bun run typecheck
|
||||||
|
EOF
|
||||||
|
|
||||||
|
chmod +x .git/hooks/pre-push
|
||||||
|
echo "✅ Pre-push hook installed"
|
|
@ -1,3 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
goreleaser build --clean --snapshot --skip validate
|
|
Loading…
Add table
Add a link
Reference in a new issue