mirror of
https://github.com/tests-always-included/mo.git
synced 2024-12-18 08:26:21 +00:00
Improved portability by using /usr/bin/env pragma
This commit is contained in:
parent
6dc284f05a
commit
53e3208ba0
@ -91,7 +91,7 @@ How to Use
|
||||
|
||||
If you only plan using strings and numbers, nothing could be simpler. In your shell script you can choose to export the variables. The below script is [`demo/using-strings`](demo/using-strings).
|
||||
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
cd "$(dirname "$0")" # Go to the script's directory
|
||||
export TEST="This is a test"
|
||||
echo "Your message: {{TEST}}" | ../mo
|
||||
@ -100,7 +100,7 @@ The result? "Your message: This is a test".
|
||||
|
||||
Using arrays adds a slight level of complexity. *You must source `mo`.* Look at [`demo/using-arrays`](demo/using-arrays).
|
||||
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
cd "$(dirname "$0")" # Go to the script's directory
|
||||
export ARRAY=( one two "three three three" four five )
|
||||
. ../mo # This loads the "mo" function
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd "$(dirname "$0")" # Go to the script's directory
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# This embeds a template in the script without using strange `cat` syntax.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# This sources a simple script with the env. variables needed for the template.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd "$(dirname "$0")" # Go to the script's directory
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd "$(dirname "$0")" # Go to the script's directory
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd "$(dirname "$0")"/..
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# This sources a simple script with the env. variables needed for the template.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
cd "$(dirname "$0")" # Go to the script's directory
|
||||
export ARRAY=( one two "three three three" four five )
|
||||
. ../mo
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# This example does not source `mo` and is intentionally restricted to
|
||||
# variables that are not arrays.
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# This requires tomdoc.sh to be in your PATH.
|
||||
# https://github.com/tests-always-included/tomdoc.sh
|
||||
|
@ -64,7 +64,7 @@ function runTest(test, done) {
|
||||
var output, partials, script;
|
||||
|
||||
script = [
|
||||
'#!/bin/bash'
|
||||
'#!/usr/bin/env bash'
|
||||
];
|
||||
partials = test.partials || {};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user