Skip to content

Commit

Permalink
Fix/typos (#2)
Browse files Browse the repository at this point in the history
* fix codacy reporter step indent

* rename workflow

* update go version

* add coverage badge

* rename binary to fileb
  • Loading branch information
B87 authored Dec 31, 2023
1 parent b804b92 commit ddbb334
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 52 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go Test
name: build

on: [push]

Expand All @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '^1.17' # Set the Go version as per your project requirement
go-version: '^1.21' # Set the Go version as per your project requirement

- name: Test and Generate Coverage Report
run: |
Expand All @@ -24,9 +24,9 @@ jobs:
exit 1
fi
- name: Codacy Coverage Reporter
if: success()
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: |
bash <(curl -Ls https://coverage.codacy.com/get.sh) report --force-coverage-parser go -r .coverage/cover.out
- name: Codacy Coverage Reporter
if: success()
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: |
bash <(curl -Ls https://coverage.codacy.com/get.sh) report --force-coverage-parser go -r .coverage/cover.out
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
completion.sh
filer
_filer
fileb
_fileb
.vscode
.coverage
69 changes: 36 additions & 33 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/54e6788204d54ffeb627e2da1958c9cc)](https://app.codacy.com/gh/B87/file-bridge/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/54e6788204d54ffeb627e2da1958c9cc)](https://app.codacy.com/gh/B87/file-bridge/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/54e6788204d54ffeb627e2da1958c9cc)](https://app.codacy.com/gh/B87/file-bridge/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage) ![build main](https://github.com/B87/file-bridge/actions/workflows/go.yml/badge.svg?branch=main)
# File Bridge: Go Multi-tool for File Manipulation across File Systems

File Bridge (fileb) is a versatile tool developed in Go (Golang) designed for efficient file and directory manipulation. It provides both a Command-Line Interface (CLI) and a library.
Expand All @@ -12,78 +12,81 @@ This tool is capable of handling basic operations across various file systems, s
## Supported File Systems

- **Local File System:** Directly manage files on your local machine.
- **Google Cloud Platform (GCP):** Use Google Storage buckets as file systems.
- **Google Cloud Platform (GCP):** Use Google Storage (GS) buckets as file systems.

## Installation

### 1. Setup env variables

| Env Var | Default | Description |
| ------------------------------ | ------- | ----------------------------------------- |
| GOOGLE_APPLICATION_CREDENTIALS | None | (Optional) Used by GGP Storage FileSystem |
| Env Var | Default | Description |
| :----------------------------: | :-----: | :---------------------------------------: |
| GOOGLE_APPLICATION_CREDENTIALS | None | (Optional) Used by GGP Storage FileSystem |


### 2. Run bash install script ``sudo bash scripts/install.sh``
### 2. (Optional) Run bash install script

`sudo bash scripts/install.sh`

This script will build from source and add the binary to /usr/local/bin

Assumptions:
- Go is installed and available in your path
- /usr/local/bin exists and is inside $PATH

### 3. Run

`fileb` or `go run .`

## CLI
## CLI

### List

`fileb help ls`

#### List Examples
| Command | Description |
| ----------------------------- | ------------------------------------------------ |
| `fileb ls ~/` | Lists local filesystem user home |
| `fileb ls gs://bucket/folder` | Lists "folder" of Google Storage bucket "bucket" |
| Example | Description |
| :---------------------------: | :------------------------------: |
| `fileb ls ~/` | Lists local filesystem user home |
| `fileb ls gs://bucket/folder` | Lists folder of GS bucket |


### Copy

`fileb help cp`

#### Copy Examples

| Command | Description |
| ------------------------------------------- | ------------------------------------------------ |
| `fileb cp ~/example.txt ~/folder` | Copy local file example.txt to local folder |
| `fileb cp ~/example.txt gs://bucket/folder` | Lists "folder" of Google Storage bucket "bucket" |
| Example | Description |
| :-----------------------------------------: | :-----------------------------------------: |
| `fileb cp ~/example.txt ~/folder` | Copy local file example.txt to local folder |
| `fileb cp ~/example.txt gs://bucket/folder` | Lists "folder" of GS bucket "bucket" |

### Move
`fileb help mv`

| Command | Description |
| ------------------------------------------- | -------------------------------------------------- |
| `fileb cp ~/example.txt ~/folder` | Copy local file example.txt to local folder |
| `fileb cp ~/example.txt gs://bucket/folder` | Lists "folder" from Google Storage bucket "bucket" |
| Example | Description |
| :-----------------------------------------: | :-----------------------------------------: |
| `fileb cp ~/example.txt ~/folder` | Copy local file example.txt to local folder |
| `fileb cp ~/example.txt gs://bucket/folder` | Lists "folder" from GS bucket "bucket" |

### Remove
`fileb help rm`

| Command | Description |
| -------------------------------- | --------------------------------------------------- |
| `fileb rm ~/example.txt` | Remove local file example.txt |
| `fileb rm -r gs://bucket/folder` | Remove "folder" from Google Storage bucket "bucket" |
| Example | Description |
| :------------------------------: | :-------------------------------------: |
| `fileb rm ~/example.txt` | Remove local file example.txt |
| `fileb rm -r gs://bucket/folder` | Remove "folder" from GS bucket "bucket" |

### Make Dir
| Command | Description |
| -------------------------------- | ------------------------------------------ |
| `fileb mkdir ~/folder` | Creates local empty folder |
| `fileb mkdir gs://bucket/folder` | Creates empty folder Google Storage bucket |

`fileb help mkdir`
| Example | Description |
| :------------------------------: | :----------------------------: |
| `fileb mkdir ~/folder` | Creates local empty folder |
| `fileb mkdir gs://bucket/folder` | Creates empty folder GS bucket |

## Packages (pkg)

### Filesys
### filesys

Manage files and file systems

### Image
### image

Adapted version of [imaging](https://github.com/disintegration/imaging) to manipulate images
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (

// RootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{
Use: "filer",
Short: "Filer CLI",
Use: "fileb",
Short: "File Bridge CLI",
Long: `
Filer CLI interacts with files across file systems.
File Bridge CLI interacts with files across file systems.
`,
}

Expand Down
8 changes: 2 additions & 6 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#! /bin/bash

go build -o filer .
go build -o fileb .

## Create symklink to /usr/local/bin
sudo ln -sf "$PWD"/filer /usr/local/bin/filer

filer completion zsh > _filer

sudo ln -sf "$PWD"/_filer "$(brew --prefix)"/share/zsh-autocomplete/_filer
sudo ln -sf "$PWD"/fileb /usr/local/bin/fileb

0 comments on commit ddbb334

Please sign in to comment.