Compare commits
4
Commits
b371c74e9a
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1159be59d0 | ||
|
|
0fc0684801 | ||
|
|
bcddfd13e7 | ||
|
|
4472bbc2e9 |
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
name: grill-me
|
||||||
|
description: Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
|
||||||
|
---
|
||||||
|
|
||||||
|
Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
|
||||||
|
|
||||||
|
Ask the questions one at a time.
|
||||||
|
|
||||||
|
If a question can be answered by exploring the codebase, explore the codebase instead.
|
||||||
@@ -84,6 +84,12 @@ func Sync(packages []string, noCheck bool, prune bool) (*output.Result, error) {
|
|||||||
|
|
||||||
var removed int
|
var removed int
|
||||||
if prune {
|
if prune {
|
||||||
|
log.Debug("Sync: running prune sanity check...")
|
||||||
|
if err := pruneSanityCheck(packages); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
log.Debug("Sync: prune sanity check passed (%.2fs)", time.Since(start).Seconds())
|
||||||
|
|
||||||
log.Debug("Sync: marking all as deps...")
|
log.Debug("Sync: marking all as deps...")
|
||||||
if err := markAllAsDeps(); err != nil {
|
if err := markAllAsDeps(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -183,3 +189,29 @@ func markAllAsDeps() error {
|
|||||||
log.Debug("markAllAsDeps: done (%.2fs)", time.Since(start).Seconds())
|
log.Debug("markAllAsDeps: done (%.2fs)", time.Since(start).Seconds())
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pruneSanityCheck checks if the installation of all state packages succeeded,
|
||||||
|
// before attempting to do package marking and orphan cleanup.
|
||||||
|
func pruneSanityCheck(statePackages []string) error {
|
||||||
|
start := time.Now()
|
||||||
|
log.Debug("pruneSanityCheck: starting...")
|
||||||
|
|
||||||
|
localPackages, err := read.List()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to list local packages: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var missing []string
|
||||||
|
for _, pkg := range statePackages {
|
||||||
|
if !slices.Contains(localPackages, pkg) {
|
||||||
|
missing = append(missing, pkg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(missing) > 0 {
|
||||||
|
return fmt.Errorf("safety check: missing state packages: %v", missing)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Debug("pruneSanityCheck: done (%.2fs)", time.Since(start).Seconds())
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
+19
-5
@@ -215,6 +215,11 @@ func findPKGFile(pkgName string, dir string) (string, error) {
|
|||||||
if !strings.HasSuffix(name, ".pkg.tar.zst") && !strings.HasSuffix(name, ".pkg.tar.gz") {
|
if !strings.HasSuffix(name, ".pkg.tar.zst") && !strings.HasSuffix(name, ".pkg.tar.gz") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// Skip packages that do not start with the exact package name, ex: sunshine-bin -> sunshine
|
||||||
|
if !strings.HasPrefix(name, pkgName) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
// Skip packages that provide a debug package, ex: sunshine-bin -> sunshine-debug
|
||||||
if strings.HasPrefix(name, pkgName+"-debug") {
|
if strings.HasPrefix(name, pkgName+"-debug") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -268,17 +273,26 @@ func resolveAndInstallDeps(f *fetch.Fetcher, aurInfo *aur.Package, logWriter io.
|
|||||||
return fmt.Errorf("failed to resolve dependencies: %w", err)
|
return fmt.Errorf("failed to resolve dependencies: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var aurDeps []string
|
var repoDeps, aurDeps []string
|
||||||
for _, dep := range depends {
|
for _, dep := range depends {
|
||||||
info := resolved[dep]
|
info := resolved[dep]
|
||||||
if info.Installed {
|
if info.Installed {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if info.Exists {
|
pkg := dep
|
||||||
continue
|
if info.Provided != "" {
|
||||||
|
pkg = info.Provided
|
||||||
}
|
}
|
||||||
if info.InAUR {
|
if info.Exists {
|
||||||
aurDeps = append(aurDeps, dep)
|
repoDeps = append(repoDeps, pkg)
|
||||||
|
} else if info.InAUR {
|
||||||
|
aurDeps = append(aurDeps, pkg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(repoDeps) > 0 {
|
||||||
|
if err := SyncPackages(repoDeps, logWriter); err != nil {
|
||||||
|
return fmt.Errorf("failed to install repo dependencies: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,12 @@
|
|||||||
"source": "JuliusBrussee/caveman",
|
"source": "JuliusBrussee/caveman",
|
||||||
"sourceType": "github",
|
"sourceType": "github",
|
||||||
"computedHash": "a818cdc41dcfaa50dd891c5cb5e5705968338de02e7e37949ca56e8c30ad4176"
|
"computedHash": "a818cdc41dcfaa50dd891c5cb5e5705968338de02e7e37949ca56e8c30ad4176"
|
||||||
|
},
|
||||||
|
"grill-me": {
|
||||||
|
"source": "mattpocock/skills",
|
||||||
|
"sourceType": "github",
|
||||||
|
"skillPath": "skills/productivity/grill-me/SKILL.md",
|
||||||
|
"computedHash": "784f0dbb7403b0f00324bce9a112f715342777a0daee7bbb7385f9c6f0a170ea"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user