mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-01 15:32:11 +08:00
refactor: clean kilo artifacts before compat commit
This commit is contained in:
@@ -362,6 +362,13 @@ async function main() {
|
||||
const keepOursResults = await resetToOurs(config.keepOurs, { dryRun: false, verbose: options.verbose })
|
||||
logger.success(`Reset ${keepOursResults.length} files to Kilo's version`)
|
||||
|
||||
// Clean untracked build artifacts from Kilo-specific directories.
|
||||
// These packages don't exist in upstream, so their .gitignore files are absent
|
||||
// on the opencode branch. Artifacts like bin/, out/, .next/ etc. would otherwise
|
||||
// be picked up by the git add -A below.
|
||||
logger.info("Cleaning Kilo-specific directory artifacts...")
|
||||
await git.cleanDirectories(config.kiloDirectories)
|
||||
|
||||
// Commit all transformations
|
||||
await git.stageAll()
|
||||
await git.commit(`refactor: kilo compat for ${targetVersion.tag}`)
|
||||
|
||||
@@ -203,6 +203,10 @@ export const defaultConfig: MergeConfig = {
|
||||
"packages/opencode/test/kilocode",
|
||||
"packages/kilo-gateway",
|
||||
"packages/kilo-telemetry",
|
||||
"packages/kilo-vscode",
|
||||
"packages/kilo-ui",
|
||||
"packages/kilo-docs",
|
||||
"packages/kilo-i18n",
|
||||
"script/upstream",
|
||||
],
|
||||
|
||||
|
||||
@@ -215,6 +215,17 @@ export async function checkoutTheirs(files: string[]): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove untracked files and directories from specific directories.
|
||||
* Used to clean build artifacts from Kilo-specific directories after checking
|
||||
* out the upstream branch, where package-level .gitignore files don't exist.
|
||||
*/
|
||||
export async function cleanDirectories(dirs: string[]): Promise<void> {
|
||||
for (const dir of dirs) {
|
||||
await $`git clean -fd ${dir}`.quiet().nothrow()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the "ours" version of a conflicted file contains kilocode_change markers.
|
||||
* Uses git stage :2: which is the "ours" side during a merge conflict.
|
||||
|
||||
Reference in New Issue
Block a user