Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add release.format option #45

Closed
4513ECHO opened this issue May 8, 2022 · 1 comment
Closed

Add release.format option #45

4513ECHO opened this issue May 8, 2022 · 1 comment

Comments

@4513ECHO
Copy link

4513ECHO commented May 8, 2022

WHAT

(Write what you need)

How about add release.format option like that of
aqua, a project very similar to afx?

 github:
   - name: high-moctane/mocword-data
     description: Predict next words.
     owner: high-moctane
     repo: mocword-data
     release:
       name: mocword.sqlite.gz
       tag: eng20200217
+      format: gz
     command:
       env:
         MOCWORD_DATA: $XDG_CACHE_HOME/mocword/mocword.sqlite
       link:
         - from: mocword.sqlite
           to: $XDG_CACHE_HOME/mocword/mocword.sqlite

WHY

(Write the background of this issue)

Currently afx detects the format of archives
by extention.
However it is failed when the name of release has dot like below.

github:
  - name: high-moctane/mocword-data
    description: Predict next words.
    owner: high-moctane
    repo: mocword-data
    release:
      name: mocword.sqlite.gz
      tag: eng20200217
    command:
      env:
        MOCWORD_DATA: $XDG_CACHE_HOME/mocword/mocword.sqlite
      link:
        - from: mocword.sqlite
          to: $XDG_CACHE_HOME/mocword/mocword.sqlite
@babarot
Copy link
Owner

babarot commented May 29, 2022

Thank you for raising issue.

It has been fixed in v0.1.24 v0.1.23...babarot/fix-45

$ AFX_LOG=debug afx i
2022/05/29 14:22:14 [INFO] afx version: unset
2022/05/29 14:22:14 [INFO] Go runtime version: go1.17.6
2022/05/29 14:22:14 [INFO] Build tag/SHA: unset/unset
2022/05/29 14:22:14 [INFO] CLI args: []string{"afx", "i"}
2022/05/29 14:22:14 [INFO] Reading config /Users/babarot/.config/afx/gist.yaml...
2022/05/29 14:22:14 [DEBUG] (goroutine): checking new updates...
2022/05/29 14:22:14 [INFO] Parsing config...
2022/05/29 14:22:14 [INFO] Reading config /Users/babarot/.config/afx/github.yaml...
2022/05/29 14:22:14 [INFO] Parsing config...
2022/05/29 14:22:14 [INFO] Reading config /Users/babarot/.config/afx/http.yaml...
2022/05/29 14:22:14 [INFO] Parsing config...
2022/05/29 14:22:14 [INFO] Reading config /Users/babarot/.config/afx/local.yaml...
2022/05/29 14:22:14 [INFO] Parsing config...
2022/05/29 14:22:14 [INFO] Reading config /Users/babarot/.config/afx/main.yaml...
2022/05/29 14:22:14 [INFO] Parsing config...
2022/05/29 14:22:14 [INFO] Reading config /Users/babarot/.config/afx/release.yaml...
2022/05/29 14:22:14 [INFO] Parsing config...
2022/05/29 14:22:14 [DEBUG] dependency graph is here:
* zsh -> google-cloud-sdk
2022/05/29 14:22:14 [DEBUG] mkdir /Users/babarot/.afx
2022/05/29 14:22:14 [DEBUG] mkdir /Users/babarot/bin
2022/05/29 14:22:14 [ERROR] there're some states or packages which needs operations: cannot refresh state
2022/05/29 14:22:14 [INFO] state additions: (1) []string{"high-moctane/mocword-data"}
2022/05/29 14:22:14 [INFO] state deletions: (2) []string{"zsh", "google-cloud-sdk"}
2022/05/29 14:22:14 [INFO] state changes: (0) []string(nil)
2022/05/29 14:22:14 [INFO] state unchanges: (76) []string{...skip...}
? OK to install these packages? high-moctane/mocword-data Yes
? Please type your GITHUB_TOKEN [? for help] ****************************************
2022/05/29 14:22:20 [DEBUG] (install): start to run each pkg.Install()
2022/05/29 14:22:20 [DEBUG] getting asset data from https://api.github.com/repos/high-moctane/mocword-data/releases/tags/eng20200217
2022/05/29 14:22:21 [DEBUG] assets: []string{"mocword.sqlite.gz"}
2022/05/29 14:22:21 [DEBUG] asset: mocword-data: using default assets filter
2022/05/29 14:22:21 [DEBUG] assets.filter: finished filtering because length of assets is less than two
2022/05/29 14:22:21 [DEBUG] assets.filter: finished filtering because length of assets is less than two
2022/05/29 14:22:21 [DEBUG] assets.filter: finished filtering because length of assets is less than two
2022/05/29 14:22:21 [DEBUG] assets.filter: finished filtering because length of assets is less than two
2022/05/29 14:22:21 [DEBUG] asset: github.Asset{Name:"mocword.sqlite.gz", URL:"https://github.com/high-moctane/mocword-data/releases/download/eng20200217/mocword.sqlite.gz"}
2022/05/29 14:23:49 [DEBUG] uaIface: &archiver.Gz{CompressionLevel:-1} (*archiver.Gz)
2022/05/29 14:24:04 [DEBUG] removed archive file: /Users/babarot/.afx/github.com/high-moctane/mocword-data/mocword.sqlite.gz
2022/05/29 14:24:04 [DEBUG] created symlink /Users/babarot/.afx/github.com/high-moctane/mocword-data/mocword.sqlite to /Users/babarot/bin/mocword.sqlite
✔ high-moctane/mocword-data
2022/05/29 14:24:04 [DEBUG] high-moctane/mocword-data: added to state
2022/05/29 14:24:04 [INFO] root command execution finished
$ ls ~/.afx/github.com/high-moctane/mocword-data/
mocword.sqlite

$ file ~/.afx/github.com/high-moctane/mocword-data/mocword.sqlite
/Users/babarot/.afx/github.com/high-moctane/mocword-data/mocword.sqlite: SQLite 3.x database, last written using SQLite version 3036000

@babarot babarot closed this as completed May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants