mirror of
https://github.com/shimataro/ssh-key-action.git
synced 2025-06-19 22:52:10 +10:00
* first action! (#1)
This commit is contained in:
parent
8deacc95b1
commit
ace1e6a69a
3750 changed files with 1155519 additions and 0 deletions
6
node_modules/flush-write-stream/.travis.yml
generated
vendored
Normal file
6
node_modules/flush-write-stream/.travis.yml
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- '4'
|
||||
- '6'
|
||||
- '8'
|
||||
- '10'
|
21
node_modules/flush-write-stream/LICENSE
generated
vendored
Normal file
21
node_modules/flush-write-stream/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Mathias Buus
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
59
node_modules/flush-write-stream/README.md
generated
vendored
Normal file
59
node_modules/flush-write-stream/README.md
generated
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
# flush-write-stream
|
||||
|
||||
A write stream constructor that supports a flush function that is called before `finish` is emitted
|
||||
|
||||
```
|
||||
npm install flush-write-stream
|
||||
```
|
||||
|
||||
[](http://travis-ci.org/mafintosh/flush-write-stream)
|
||||
|
||||
## Usage
|
||||
|
||||
``` js
|
||||
var writer = require('flush-write-stream')
|
||||
|
||||
var ws = writer(write, flush)
|
||||
|
||||
ws.on('finish', function () {
|
||||
console.log('finished')
|
||||
})
|
||||
|
||||
ws.write('hello')
|
||||
ws.write('world')
|
||||
ws.end()
|
||||
|
||||
function write (data, enc, cb) {
|
||||
// i am your normal ._write method
|
||||
console.log('writing', data.toString())
|
||||
cb()
|
||||
}
|
||||
|
||||
function flush (cb) {
|
||||
// i am called before finish is emitted
|
||||
setTimeout(cb, 1000) // wait 1 sec
|
||||
}
|
||||
```
|
||||
|
||||
If you run the above it will produce the following output
|
||||
|
||||
```
|
||||
writing hello
|
||||
writing world
|
||||
(nothing happens for 1 sec)
|
||||
finished
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
#### `var ws = writer([options], write, [flush])`
|
||||
|
||||
Create a new writable stream. Options are forwarded to the stream constructor.
|
||||
|
||||
#### `var ws = writer.obj([options], write, [flush])`
|
||||
|
||||
Same as the above except `objectMode` is set to `true` per default.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
22
node_modules/flush-write-stream/example.js
generated
vendored
Normal file
22
node_modules/flush-write-stream/example.js
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
var writer = require('./')
|
||||
|
||||
var ws = writer(write, flush)
|
||||
|
||||
ws.on('finish', function () {
|
||||
console.log('finished')
|
||||
})
|
||||
|
||||
ws.write('hello')
|
||||
ws.write('world')
|
||||
ws.end()
|
||||
|
||||
function write (data, enc, cb) {
|
||||
// i am your normal ._write method
|
||||
console.log('writing', data.toString())
|
||||
cb()
|
||||
}
|
||||
|
||||
function flush (cb) {
|
||||
// i am called before finish is emitted
|
||||
setTimeout(cb, 1000) // wait 1 sec
|
||||
}
|
54
node_modules/flush-write-stream/index.js
generated
vendored
Normal file
54
node_modules/flush-write-stream/index.js
generated
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
var stream = require('readable-stream')
|
||||
var inherits = require('inherits')
|
||||
|
||||
var SIGNAL_FLUSH =(Buffer.from && Buffer.from !== Uint8Array.from)
|
||||
? Buffer.from([0])
|
||||
: new Buffer([0])
|
||||
|
||||
module.exports = WriteStream
|
||||
|
||||
function WriteStream (opts, write, flush) {
|
||||
if (!(this instanceof WriteStream)) return new WriteStream(opts, write, flush)
|
||||
|
||||
if (typeof opts === 'function') {
|
||||
flush = write
|
||||
write = opts
|
||||
opts = {}
|
||||
}
|
||||
|
||||
stream.Writable.call(this, opts)
|
||||
|
||||
this.destroyed = false
|
||||
this._worker = write || null
|
||||
this._flush = flush || null
|
||||
}
|
||||
|
||||
inherits(WriteStream, stream.Writable)
|
||||
|
||||
WriteStream.obj = function (opts, worker, flush) {
|
||||
if (typeof opts === 'function') return WriteStream.obj(null, opts, worker)
|
||||
if (!opts) opts = {}
|
||||
opts.objectMode = true
|
||||
return new WriteStream(opts, worker, flush)
|
||||
}
|
||||
|
||||
WriteStream.prototype._write = function (data, enc, cb) {
|
||||
if (SIGNAL_FLUSH === data) this._flush(cb)
|
||||
else this._worker(data, enc, cb)
|
||||
}
|
||||
|
||||
WriteStream.prototype.end = function (data, enc, cb) {
|
||||
if (!this._flush) return stream.Writable.prototype.end.apply(this, arguments)
|
||||
if (typeof data === 'function') return this.end(null, null, data)
|
||||
if (typeof enc === 'function') return this.end(data, null, enc)
|
||||
if (data) this.write(data)
|
||||
if (!this._writableState.ending) this.write(SIGNAL_FLUSH)
|
||||
return stream.Writable.prototype.end.call(this, cb)
|
||||
}
|
||||
|
||||
WriteStream.prototype.destroy = function (err) {
|
||||
if (this.destroyed) return
|
||||
this.destroyed = true
|
||||
if (err) this.emit('error', err)
|
||||
this.emit('close')
|
||||
}
|
54
node_modules/flush-write-stream/package.json
generated
vendored
Normal file
54
node_modules/flush-write-stream/package.json
generated
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
"_from": "flush-write-stream@^1.0.0",
|
||||
"_id": "flush-write-stream@1.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==",
|
||||
"_location": "/flush-write-stream",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "flush-write-stream@^1.0.0",
|
||||
"name": "flush-write-stream",
|
||||
"escapedName": "flush-write-stream",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/mississippi"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz",
|
||||
"_shasum": "8dd7d873a1babc207d94ead0c2e0e44276ebf2e8",
|
||||
"_spec": "flush-write-stream@^1.0.0",
|
||||
"_where": "/home/shimataro/projects/actions/ssh-key-action/node_modules/mississippi",
|
||||
"author": {
|
||||
"name": "Mathias Buus",
|
||||
"url": "@mafintosh"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/mafintosh/flush-write-stream/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"readable-stream": "^2.3.6"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "A write stream constructor that supports a flush function that is called before finish is emitted",
|
||||
"devDependencies": {
|
||||
"tape": "^4.2.2"
|
||||
},
|
||||
"homepage": "https://github.com/mafintosh/flush-write-stream",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "flush-write-stream",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/mafintosh/flush-write-stream.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape test.js"
|
||||
},
|
||||
"version": "1.1.1"
|
||||
}
|
85
node_modules/flush-write-stream/test.js
generated
vendored
Normal file
85
node_modules/flush-write-stream/test.js
generated
vendored
Normal file
|
@ -0,0 +1,85 @@
|
|||
var tape = require('tape')
|
||||
var writer = require('./')
|
||||
|
||||
tape('is a write stream', function (t) {
|
||||
var expected = ['hello', 'world', 'verden']
|
||||
var ws = writer.obj(write)
|
||||
|
||||
ws.write('hello')
|
||||
ws.write('world')
|
||||
ws.write('verden')
|
||||
ws.end(function () {
|
||||
t.same(expected.length, 0)
|
||||
t.end()
|
||||
})
|
||||
|
||||
function write (data, enc, cb) {
|
||||
t.same(data, expected.shift())
|
||||
cb()
|
||||
}
|
||||
})
|
||||
|
||||
tape('is flushable', function (t) {
|
||||
var expected = ['hello', 'world', 'verden']
|
||||
var flushed = false
|
||||
|
||||
var ws = writer.obj(write, flush)
|
||||
|
||||
ws.write('hello')
|
||||
ws.write('world')
|
||||
ws.write('verden')
|
||||
ws.end(function () {
|
||||
t.same(expected.length, 0)
|
||||
t.ok(flushed, 'was flushed')
|
||||
t.end()
|
||||
})
|
||||
|
||||
function write (data, enc, cb) {
|
||||
t.same(data, expected.shift())
|
||||
cb()
|
||||
}
|
||||
|
||||
function flush (cb) {
|
||||
flushed = true
|
||||
process.nextTick(cb)
|
||||
}
|
||||
})
|
||||
|
||||
tape('can pass options', function (t) {
|
||||
var expected = ['hello', 'world', 'verden']
|
||||
var flushed = false
|
||||
|
||||
var ws = writer({objectMode: true}, write, flush)
|
||||
|
||||
ws.write('hello')
|
||||
ws.write('world')
|
||||
ws.write('verden')
|
||||
ws.end(function () {
|
||||
t.same(expected.length, 0)
|
||||
t.ok(flushed, 'was flushed')
|
||||
t.end()
|
||||
})
|
||||
|
||||
function write (data, enc, cb) {
|
||||
t.same(data, expected.shift())
|
||||
cb()
|
||||
}
|
||||
|
||||
function flush (cb) {
|
||||
flushed = true
|
||||
process.nextTick(cb)
|
||||
}
|
||||
})
|
||||
|
||||
tape('emits error on destroy', function (t) {
|
||||
var expected = new Error()
|
||||
|
||||
var ws = writer({objectMode: true}, function () {})
|
||||
|
||||
ws.on('error', function (err) {
|
||||
t.equal(err, expected)
|
||||
})
|
||||
ws.on('close', t.end)
|
||||
|
||||
ws.destroy(expected)
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue