https://github.com/hangxingliu/add-bash-attachment
📦 A Node.js utils/module be used for add attachment files into bash script.
https://github.com/hangxingliu/add-bash-attachment
bash
Last synced: 2 months ago
JSON representation
📦 A Node.js utils/module be used for add attachment files into bash script.
- Host: GitHub
- URL: https://github.com/hangxingliu/add-bash-attachment
- Owner: hangxingliu
- License: gpl-3.0
- Created: 2018-09-17T23:20:27.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-20T06:13:26.000Z (almost 8 years ago)
- Last Synced: 2026-03-14T04:45:14.372Z (4 months ago)
- Topics: bash
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# add-bash-attachment
[](https://travis-ci.org/hangxingliu/add-bash-attachment)
A Node.js utils/module be used for add attachment files into bash script.
## Install
``` bash
npm install add-bash-attachment --global
```
## Usage
### As command line tools:
``` bash
add-bash-attachment --input raw.sh \
--file signs.key --file sources.list \
--output install.sh
```
### As a Node.js module:
``` javascript
const { addAttachments } = require('add-bash-attachment');
addAttachments({
inputFile: 'raw.sh',
attachments: [{
name: 'data.bin',
content: fs.readFileSync('data.bin'),
}]
}).then(newScript => {
console.log(newScript);
}).catch(error => {
console.error(error);
});
```
## Principle
Prepend bash function `get_bash_attachment` and attachment contents as base64 string.
## Author
👨💻 [@hangxingliu (Liu Yue)](https://github.com/hangxingliu)
## License
[GPL-3.0](LICENSE)