@@ -23,7 +23,8 @@ chmod +x inline_source
2323
2424## Usage
2525
26- This script will output a file for a given path, will all ` sourced ` files inlined.
26+ This script will output a file for a given path, will all ` sourced ` files
27+ inlined.
2728
2829``` sh
2930inline_source < source-file>
@@ -32,6 +33,7 @@ inline_source <source-file>
3233For instance, given a file ` a.sh ` and file ` b.sh ` like this:
3334
3435** a.sh**
36+
3537``` sh
3638#! /usr/bin/env bash
3739
@@ -41,6 +43,7 @@ source 'b.sh.'
4143```
4244
4345** b.sh**
46+
4447``` sh
4548#! /usr/bin/env bash
4649
@@ -69,7 +72,7 @@ main script is placed inline.
6972
7073This allows for a single script to be created for distribution purposes.
7174
72- For instance, the distribution file in this repo was created by pipe-ing the
75+ For instance, the distribution file in this repo was created by piping the
7376output to a file:
7477
7578``` sh
@@ -81,7 +84,7 @@ find. To clean things up, pipe this script through a formatter, for instance
8184[ shfmt] ( https://github.com/mvdan/sh ) :
8285
8386``` sh
84- inline_source inline_source.sh | shfmt -i 2 -ci -s > dist/inline_source
87+ inline_source inline_source.sh | shfmt -bn -ci -sr -s -i 4 > dist/inline_source
8588```
8689
8790## Development
@@ -90,9 +93,12 @@ This repository is set up like this:
9093
9194```
9295 .
96+ ├── build/ <-- Build artifacts
9397 ├── deps/ <-- Third-party dependencies
9498 ├── dist/ <-- Bundled distribution script
99+ ├── spec/ <-- Test suite
95100 ├── src/ <-- Source files
101+ ├── .shellspec <-- ShellSpec configuration
96102 ├── bpkg.json <-- Package declaration
97103 ├── inline_source.sh <-- Main script
98104 └── README.md <-- You are here
@@ -113,8 +119,8 @@ using a docker image for `shfmt`), run:
113119
114120``` sh
115121bash inline_source.sh inline_source.sh \
116- | docker run -i --rm --volume=" $PWD :/mnt" -w /mnt mvdan/shfmt -i 2 -ci -s \
117- > dist/inline_source
122+ | docker run -i --rm --volume=" $PWD :/mnt" -w /mnt mvdan/shfmt -bn -ci -sr -s -i 4 \
123+ > dist/inline_source
118124```
119125
120126This will create a distribution file in the ` dist/ ` directory.
0 commit comments