Compare commits
1 Commits
eb05e27655
..
0.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
| c53b23b6fd |
@@ -61,10 +61,8 @@ jobs:
|
||||
tar czf "${{ matrix.archive }}" "${{ matrix.binary }}"
|
||||
fi
|
||||
|
||||
- name: Upload to release
|
||||
run: |
|
||||
curl --fail -X POST \
|
||||
-H "Authorization: Bearer ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @"target/${{ matrix.target }}/release/${{ matrix.archive }}" \
|
||||
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=${{ matrix.archive }}"
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.archive }}
|
||||
path: target/${{ matrix.target }}/release/${{ matrix.archive }}
|
||||
|
||||
@@ -19,8 +19,6 @@ pub struct SkillEntry {
|
||||
pub repository: String,
|
||||
#[serde(default)]
|
||||
pub branch: Option<String>,
|
||||
#[serde(default)]
|
||||
pub path: Option<String>,
|
||||
}
|
||||
|
||||
pub fn add(url: &str, name: Option<&str>) -> Result<MarketplaceEntry, String> {
|
||||
|
||||
+3
-17
@@ -38,20 +38,10 @@ pub fn install(
|
||||
let branch = entry.branch.as_deref().unwrap_or("main");
|
||||
download::download_skill(&entry.repository, branch, &target)?;
|
||||
|
||||
let deploy_source = match &entry.path {
|
||||
Some(subdir) => {
|
||||
let p = target.join(subdir);
|
||||
if !p.exists() {
|
||||
return Err(format!("Path '{}' not found in skill repository", subdir));
|
||||
}
|
||||
p
|
||||
}
|
||||
None => target.clone(),
|
||||
};
|
||||
|
||||
// Deploy to Claude skills directory (copy or link)
|
||||
let config = Config::load().map_err(|e| format!("Cannot read config: {e}"))?;
|
||||
let deploy_mode = mode.unwrap_or_else(|| config.default_mode.clone());
|
||||
deploy_skill(name, &deploy_source, &deploy_mode)?;
|
||||
deploy_skill(name, &target, &deploy_mode)?;
|
||||
|
||||
Ok(Skill {
|
||||
name: name.to_string(),
|
||||
@@ -243,16 +233,12 @@ pub fn update(name: Option<&str>) -> Result<Vec<(String, String)>, String> {
|
||||
|
||||
match download::download_skill(&skill_entry.repository, branch, &old_path) {
|
||||
Ok(()) => {
|
||||
let deploy_source = match &skill_entry.path {
|
||||
Some(subdir) => old_path.join(subdir),
|
||||
None => old_path.clone(),
|
||||
};
|
||||
// Redeploy if previously deployed
|
||||
if deploy_mode.is_some() || config.default_mode != InstallMode::Copy {
|
||||
let mode = deploy_mode
|
||||
.clone()
|
||||
.unwrap_or_else(|| config.default_mode.clone());
|
||||
match deploy_skill(skill_name, &deploy_source, &mode) {
|
||||
match deploy_skill(skill_name, &old_path, &mode) {
|
||||
Ok(()) => results.push((skill_name.clone(), "Updated".to_string())),
|
||||
Err(e) => results.push((skill_name.clone(), format!("Downloaded but deploy failed: {e}"))),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user