mirror

module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: MIT

README ΒΆ

πŸ”³ Mirror

A command-line utility that creates projects from mirrors (project templates)

Build Status Code Coverage Go Report Card LICENSE Releases semantic-release

Table of Contents

Features

  • No dependencies (NodeJS, Python Interpreter etc.) - Mirror is a single statically linked binary. Grab the one that fits your architecture, and you're all set to save time by using templates!
  • Full Power of Golang Templates - Golang has powerful templating constructs which are very easy to learn and powerful.
  • Dead-Simple Template Creation - Creating boilerplate templates are very easy, check out the license template to see a simple, but very useful template for adding licenses to new projects with a single command.

Installation

Our home management system, Casa, is shipped with the most recent version of Mirror via lunarispkgs

Binaries for Windows, Mac, and Linux are officially supported. You can download them directly, from the release page, or run the installation script.

Please see Installation page for more information.

Getting Started

To see all available options:

mirror help

Download a Mirror

In order to download a mirror from a github repository, use the following command:

mirror download <github-repo-path> <mirror-tag>
mirror download lunaris-studios/mirror-license license

The downloaded template will be saved to local mirror registry.

Save a Local Template

In order to save a template from filesystem to the template registry use the following command:

mirror save <mirror-path> <mirror-tag>
mirror save ~/mirror-license license

The saved template will be saved to local mirror registry.

Create a template

For a mirror template with the given directory structure:

.
β”œβ”€β”€ project.json
β”œβ”€β”€ README.md
└── template
    └── LICENSE

And the following project.json context file:

{
	"Author": "John Doe",
	"Year": "2020",
	"License": ["Apache Software License 2.0", "MIT", "GNU GPL v3.0"]
}

When using the mirror with the following command:

mirror use <mirror-tag> <target-dir>
mirror use license /workspace/lunaris-studios/example-project/

The user will be prompted as follows:

[?] Please choose an option for "License"
    1 -  "Apache Software License 2.0"
    2 -  "MIT"
    3 -  "GNU GPL v3.0"
    Select from 1..3 [default: 1]: 2
[?] Please choose a value for "Year" [default: "2015"]:
[?] Please choose a value for "Author" [default: "Tamer Tas"]:
[βœ”] Created /workspace/lunaris-studios/example-project/LICENSE
[βœ”] Successfully executed the project license in /workspace/lunaris-studios/example-project

For more information please take a look at Usage and Creating Templates pages in the wiki.

List of Templates

Take a look at the Templates page for an index of project templates, examples, and more information.

Directories ΒΆ

Path Synopsis
cmd
pkg
cmd
util/git
Package git is a facade for git methods used by mirror
Package git is a facade for git methods used by mirror
util/tlog
Package tlog implements logging utilities for mirror
Package tlog implements logging utilities for mirror

Jump to

Keyboard shortcuts

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