8000 GitHub - coderofsalvation/powscript at ff8ea7ececff3551d0d53fde2d68538e6cf7f7d8
[go: up one dir, main page]

Skip to content

transpiler written in bash: painless shellscript, indentbased, coffee for the shell with hipster-sparkles v1 BETA LANDED πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰ thanks fcard!

License

Notifications You must be signed in to change notification settings

coderofsalvation/powscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

58 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

[![Travis build status](https://travis-ci.org/coderofsalvation/powscript.svg?branch=master)](https://travis-ci.org/coderofsalvation/powscript.svg?branch=master) write shellscript in a powful way!

Usage

$ wget "https://raw.githubusercontent.com/coderofsalvation/powscript/master/powscript" -O /usr/local/bin/powscript && chmod 755 /usr/local/bin/powscript
$ powscript myscript.pow                        # run directly
$ powscript --compile myscript.pow > myscript   # output bashscript

Example

#!/usr/bin/env powscript

usage(app)
  echo "$app <number>"
  
switch $1
  case [0-9]*
    echo "arg 1 is a number"
  case *
    if empty $1
      help=$(usage myapp)
      echo "Usage: $help" && exit

Reference + Examples

Check the wiki here

Features

  • memorizable syntax: more human-like, less robotic { ! [[ @ ]] || ~ and so on
  • safetynets: automatic quoting, halt on error
  • comfort: easy arrays, functional programming, named variables instead of positionals
  • written in bash 4, 'zero'-dependency solution
  • hasslefree: no installation or compilation using 3rd party software

Modules

Create 1 portable bashscript.

/myapp.pow

require 'mod/mymod.pow'
require 'mod/foo.bash'

mymodfunc
bar

/mod/mymod.pow

mymodfunc()
  echo "hi im a powscript module!"

/mod/foo.bash

function bar(){
  echo "hi im a bash module"
}

Then run powscript --compile myapp.pow > all-in-one.bash

Todo

  • on
  • first
  • last
  • filter
  • curry

Examples

Wiki

About

transpiler written in bash: painless shellscript, indentbased, coffee for the shell with hipster-sparkles v1 BETA LANDED πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰ thanks fcard!

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages

0