Skip to content
/ btt-cli Public

Like a mix about "mkdir -p" and "touch" but crossplatform.

Notifications You must be signed in to change notification settings

rawnly/btt-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BTT CLI

img

Better "touch" command.

Installation

To install btt-cli be sure to have installed npm or yarn.

  $ node --version

If no errors let's install btt-cli with the following comand:

  $ npm install btt-cli --global

  # or "shorter flags"
  $ npm i -g btt-cli

  # or with YARN
  $ yarn global add btt-cli

How

  $ btt [path]/<filename> [...content]

Why ?

Why use btt-cli instead the traditional touch filename or the classic echo > filename?

Because btt provides to create the path if it doesn't exitst yet and it doesn't overwrite files.



Example:

  $ touch myCoolProject/www/index.html
  # Now if the path 'myCoolProject/www' doesn't exists "touch" will return error.

  $ echo >> myCoolProject/www/index.html "<h1>Title</h1>"
  # This will return the same error



But here comes this commandline, btt will create the path and with btt you can also write into files as like echo, is like a mix of echo and mdkir -p commands.



Example with btt:

  $ btt myCoolProject/www/index.html "<h1> Title </h1>"

  # You can also write without “”

  $ btt Note/myFirstNote.txt Hey, this is my note!
  # This will write a file with
  # the phrase "Hey, this is my note!".

Platforms

This commandline should work over all platforms but unfortunately right now i can't test it over all them.

Tested on

  • macOS Sierra [10.12.13]
  • Linux systems
  • Windows systems





Written in ❤️ with NodeJS & Atom Text Editor by @Rawnly