An open API service indexing awesome lists of open source software.

https://github.com/akameco/touch-alt

Create from a template instead of a new file
https://github.com/akameco/touch-alt

cli cli-app cp cp-file touch touch-alt

Last synced: about 1 year ago
JSON representation

Create from a template instead of a new file

Awesome Lists containing this project

README

          

# [![touch-alt](media/logo.png)](https://github.com/akameco/touch-alt)

[![Build Status](https://travis-ci.org/akameco/touch-alt.svg?branch=master)](https://travis-ci.org/akameco/touch-alt)
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors)

> Create from a template instead of a new file

## Install

```
$ npm install --global touch-alt
```

## Demo

![demo](./media/demo.gif)

## Usage

```
$ touch-alt --help

Create from a template instead of a new file

Usage
$ touch-alt
$ touch-alt --add

Options
-a, --add Create new template file
-o, --overwrite Overwrite by template

Example
$ touch-alt .editorconfig
```

## Example

### Add new template file

```
$ cat .editorconfig
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
$ touch-alt --add .editorconfig
```

### Usage

```
# Use touch
$ touch .editorconfig
$ cat .editorconfig

$ rm .editorconfig

# Use touch-alt
$ touch-alt .editorconfig
$ cat .editorconfig
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
```

## Tip

Add `alias touch=touch-alt` to your .zshrc/.bashrc to reduce typing & create file easily.

## Config

Default: `~/.touch-alt`

```sh
$ ls ~/.touch-alt
ISSUE_TEMPLATE.md index.js readme.md
```

## Contributors

Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):

| [
akameco](http://akameco.github.io)
[💻](https://github.com/akameco/touch-alt/commits?author=akameco "Code") [📖](https://github.com/akameco/touch-alt/commits?author=akameco "Documentation") [⚠️](https://github.com/akameco/touch-alt/commits?author=akameco "Tests") [🚇](#infra-akameco "Infrastructure (Hosting, Build-Tools, etc)") | [
ryota-murakami](http://ryota-murakami.github.io/)
[🚇](#infra-ryota-murakami "Infrastructure (Hosting, Build-Tools, etc)") |
| :---: | :---: |

This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

## License

MIT © [akameco](http://akameco.github.io)