mirror of
https://github.com/tests-always-included/mo.git
synced 2024-12-18 16:27:52 +00:00
Merge pull request #60 from Swivelgames/portability
Improved portability by using /usr/bin/env pragma
This commit is contained in:
commit
b01fc43580
@ -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).
|
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
|
cd "$(dirname "$0")" # Go to the script's directory
|
||||||
export TEST="This is a test"
|
export TEST="This is a test"
|
||||||
echo "Your message: {{TEST}}" | ../mo
|
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).
|
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
|
cd "$(dirname "$0")" # Go to the script's directory
|
||||||
export ARRAY=( one two "three three three" four five )
|
export ARRAY=( one two "three three three" four five )
|
||||||
. ../mo # This loads the "mo" function
|
. ../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
|
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.
|
# 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.
|
# 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
|
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
|
cd "$(dirname "$0")" # Go to the script's directory
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
cd "$(dirname "$0")"/..
|
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.
|
# 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
|
cd "$(dirname "$0")" # Go to the script's directory
|
||||||
export ARRAY=( one two "three three three" four five )
|
export ARRAY=( one two "three three three" four five )
|
||||||
. ../mo
|
. ../mo
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# This example does not source `mo` and is intentionally restricted to
|
# This example does not source `mo` and is intentionally restricted to
|
||||||
# variables that are not arrays.
|
# variables that are not arrays.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# This requires tomdoc.sh to be in your PATH.
|
# This requires tomdoc.sh to be in your PATH.
|
||||||
# https://github.com/tests-always-included/tomdoc.sh
|
# https://github.com/tests-always-included/tomdoc.sh
|
||||||
|
@ -64,7 +64,7 @@ function runTest(test, done) {
|
|||||||
var output, partials, script;
|
var output, partials, script;
|
||||||
|
|
||||||
script = [
|
script = [
|
||||||
'#!/bin/bash'
|
'#!/usr/bin/env bash'
|
||||||
];
|
];
|
||||||
partials = test.partials || {};
|
partials = test.partials || {};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user