ghafs

command module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2020 License: MIT Imports: 13 Imported by: 0

README

ghafs

CI Status

Experimental GitHub Release Assets as FUSE filesystem mount.

This set-up only works for Linux and MacOS, since Windows does not support the concept of FUSE.

How to Use

Assuming that ghafs executable has already been built, the actual usage help looks like this:

ghafs [--token TOKEN] [--allow-other] MOUNTPOINT OWNER REPO

Note that you should not need root privileges for the above command as long as the mountpoint is a user mountable directory.

A proper example looks something like this:

mkdir -p /tmp/tera-cli
./ghafs /tmp/tera-cli guangie88 tera-cli

Note that you should try to provide the GitHub access token so that you have a much higher rate limit for GitHub API even for public repos. Also if you wish for another user (e.g. root) to see the mounted directory, you will need to specify the --allow-other flag.

Assuming you have successfully mounted after following the above given command, you should then be able to traverse into /tmp/tera-cli to look at the various release tags and assets with another terminal / file browser.

To unmount, currently one has to do the following:

  1. Press CTRL-C on the running ghafs to terminate the application
  2. Make sure no other terminal / application is running at the mountpoint
  3. If you are on Linux, you can run this to umount: fusermount -u /tmp/tera-cli. For MacOS, run umount /tmp/tera-cli instead, which may or may not require sudo (not tested).

How to Build

You will need go of version 1.12 or higher for Go module support.

Simply run

go build -v ./...

This will generate the ghafs executable.

If you prefer a fully statically linked executable that can be deployed anywhere, run with CGO_ENABLED=0 env var disabled instead, like the following:

CGO_ENABLED=0 go build -v ./...

To check that it is indeed fully statically linked, run

ldd ghafs

And make sure it reads along the line of "not a dynamic executable".

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL