carlocorradini / inline Goto Github PK
View Code? Open in Web Editor NEWInline script sources
License: MIT License
Inline script sources
License: MIT License
just to share my thoughts, having a folder structure like that:
โโโ bin
โย ย โโโ main.sh
source templates/test/a.sh
โโโ templates
โโโ test
โโโ a.sh
echo this is a
source templates/test/b.sh # required for regular bash script usage
vs
source b.sh # required with inline.sh
โโโ b.sh
echo this is b
and running main.sh
from the root dir leads to an error like:
bash bin/main.sh
...
[FATAL] Unable to resolve source file path ...
[FATAL] Error inlining file ...
it works if source
is used without path but then the usage breaks if i want to run it with a native bash call and vice versa.
some option like --relative-sourcing
vs --source-from-cwd
could be helpful
running the script on alpine/busybox fails with the following error:
readlink: unrecognized option: m
BusyBox v1.35.0 (2022-11-19 10:13:10 UTC) multi-call binary.
Usage: readlink [-fnv] FILE
Display the value of a symlink
-f Canonicalize by following all symlinks
-n Don't add newline
-v Verbose
on `alpine:3.17.0` run:
bash inline.sh --in-file test.sh
test.sh
#!/bin/ash
echo "hello"
source header.sh
header.sh
# fail on non-zero exit code
set -e -o pipefail -o errexit
Alpine Linux Busybox
hopefully helpful links:
No response
what do you think of deprecating the default name for the input-file and name the output-file something like original-script-name.inlined.sh
?
could be more intuitive when running the command without parameter, which currently lead to script.sh not found
instead of the help/usage screen.
No response
No response
Add a silent log level to disable logging
--log-level silent
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.