Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.
/ osoy-proto Public archive

First prototype of the Git repository manager Osoy.

License

Notifications You must be signed in to change notification settings

osoy/osoy-proto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 

Repository files navigation

Osoy Prototype

Successor at github.com/osoy/osoy.

Lightweight git repository manager. Inspired by vim-plug, yarn and pacman. It supports multiple git hosting services.

This is a prototype (v0.0.7) written in POSIX shell.

Table of contents

Compatibility

It has currently been tested on Linux with dash but most likely will work on BSD and macOS with bash or zsh. This software relies on extended file metadata to determine whether a file is executable.

Dependencies

sed; grep; find; ls; sort; cut; tr; curl; git

On a *nix system, chances are you already have these installed. You may have to install curl and git.

Usage

osoy [operator] [flags]

Operators

c|clone    <query*>   clone packages from GitHub, GitLab or Bitbucket
r|remove   <query*>   remove packages
s|symlink  [query*]   make packages' executables available in PATH
u|update   [query*]   update (all) packages
l|list     [query*]   list (all) packages
m|make     [query*]   make (all) packages
dir        <query>    print package's directory path
read       <query>    view package's README file
license    <query>    view package's LICENSE file
uninstall  -          uninstall osoy and all packages

Query syntax

<[[domain/]author/]package>

Flags

-d         <domain>   enforce a specific domain to clone from
-a         <author>   specify packages' author
-p         <protocol> specify a protocol other than HTTPS
-b         <branch>   specify a single branch as the HEAD
-B         -          clone all branches
-y         -          proceed with defaults
-f         -          force overwriting and/or removing
-v         -          show version
-h         -          show help menu
-c         -          enable ansi colors
-C         -          disable ansi colors

Installation

Manual initialization

Clone osoy git repository.

mkdir -p ~/.osoy/packages/github.com/osoy &&
  cd ~/.osoy/packages/github.com/osoy &&
    git clone https://github.com/osoy/osoy

Create a symbolic link for osoy executable.

mkdir -p ~/.osoy/bin &&
  ln -s ~/.osoy/packages/github.com/osoy/osoy/osoy ~/.osoy/bin/osoy

Automated bootstrap

Curl contents of the osoy file and execute with POSIX-compliant shell.

curl https://raw.githubusercontent.com/osoy/osoy/master/osoy | sh

Add to PATH

Add osoy bin directory ~/.osoy/bin to your system path.

PATH="$PATH:$HOME/.osoy/bin"

To make it permanent add the previous line to your shell profile — ~/.bash_profile, ~/.zprofile, ~/.profile, etc. More at computerhope, askubuntu or google.

Configuration

You can configure osoy by making an alias. For example, next line will enable colors by default

alias osoy='osoy -c'

Following line will make it easier to navigate to package's directory

oycd() { cd "$(osoy dir "$*")"; }

File structure

~/.osoy/
├── bin/
│   ├── <symlink>  ->  <executable>
│   :   ...
│
└── packages/
    ├── <domain>/
    │   :   ...
    │
    ├── <domain>/
    :   ├── <author>/
        │   :   ...
        │
        ├── <author>/
        :   ├── <package>/
            │   :   ...
            │
            ├── <package>/
            :   ├── <modules>/
                ├── <module>
                ├── <executable>
                :   ...

Todo

  • Rewrite in rust

About

First prototype of the Git repository manager Osoy.

Resources

License

Stars

Watchers

Forks

Languages