Skip to content

A script written in Nodejs to shorten the URL of the remote to which a git push takes place

Notifications You must be signed in to change notification settings

piyush0/Shortlr-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

Shortlr Script

shortlr Just this command will push to your origin master and will shorten the url of your remote.

Steps to make global

  1. chmod u+x shortlr
  2. Copy the executable to your bin folder

Now you can use it globally

Usage

Simple shortening

shortlr -l 'url'

If the argument is a URL, the output a shortened URL.

Example

shortlr -l http://google.com

will produces a short link pointing to google.

Push and short

shortlr 'remote-name' 'branch-name' 'directory' 'custom-code'

All the arguments are optional.

Argument Default Value Comments
remote-name origin The remote to which the git push takes place
branch-name master The branch to which git push takes place
directory The directory to which the shortcode will point, If no value is provided, shortcode points to the root of the repo.
custom-shortcode The custom shortcode that will be produced. Makes sense only if you know the secret. If no value is provided, a random shortcode is generated

Example

shortlr origin master public_static projPs

This will push your code to 'origin master' and produce a link like http://cb.lk/projPs This short link is pointing to public_static directory of your repository.

Shorten only

shortlr -s 'remote-name' 'remote-name' is an optional argument

Argument Default Value Comments
remote-name origin The remote of which you want the short link of

Example

shortlr -s origin

Produces a short link of 'origin' remote of your repository

Dependencies

Shortlr by Coding Blocks

Releases

No releases published

Packages

No packages published