The package rpms/nodejs-temp-write.git has added or updated architecture specific content
in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/nodejs-temp-write.git/commit/?id=....
Change:
-ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit 492d2503cbba329a4191fbc73b8d2948bdf111ca
Author: Miro Hrončok <miro(a)hroncok.cz>
Date: Tue Aug 4 14:24:38 2020 +0200
Retired: Fails to build since Fedora 31
https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fai...
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 3f55916..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/fixture-3.3.0.tar.bz2
-/temp-write-3.3.0.tgz
diff --git a/dead.package b/dead.package
new file mode 100644
index 0000000..cd0827a
--- /dev/null
+++ b/dead.package
@@ -0,0 +1,3 @@
+Retired: Fails to build since Fedora 31
+
+https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/
diff --git a/dl-tests.sh b/dl-tests.sh
deleted file mode 100644
index 3ab66bb..0000000
--- a/dl-tests.sh
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/bin/bash
-
-tag=$(sed -n 's/^Version:\s\(.*\)$/\1/p' ./*.spec | sed -e
's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
-url=$(sed -n 's/^URL:\s\(.*\)$/\1/p' ./*.spec | sed -e
's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
-pkgdir=$(basename $url | sed -s 's/\.git$//')
-
-echo "tag: $tag"
-echo "URL: $url"
-echo "pkgdir: $pkgdir"
-
-set -e
-
-tmp=$(mktemp -d)
-
-trap cleanup EXIT
-cleanup() {
- echo Cleaning up...
- set +e
- [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp"
-}
-
-unset CDPATH
-pwd=$(pwd)
-
-pushd "$tmp"
-git clone $url
-cd $pkgdir
-echo Finding git tag
-gittag=$(git show-ref --tags | cut -d' ' -f2 | grep "${tag}$" || git
show-ref --tags | cut -d' ' -f2 | sort -Vr | head -n1)
-if [ -z $gittag ]; then
- gittag=tags/$tag
-fi
-echo "Git Tag: $gittag"
-if [ -d "test" ]; then
- git archive --prefix='test/' --format=tar ${gittag}:test/ \
- | bzip2 > "$pwd"/tests-${tag}.tar.bz2
-elif [ -d "tests" ]; then
- git archive --prefix='tests/' --format=tar ${gittag}:tests/ \
- | bzip2 > "$pwd"/tests-${tag}.tar.bz2
-elif [ -d "spec" ]; then
- git archive --prefix='spec/' --format=tar ${gittag}:spec/ \
- | bzip2 > "$pwd"/tests-${tag}.tar.bz2
-else
- echo "No test directory found for tag ${gittag}"
-fi
-if [ -d "support" ]; then
- git archive --prefix='support/' --format=tar ${gittag}:support/ \
- | bzip2 > "$pwd"/support-${tag}.tar.bz2
-fi
-if [ -d "fixture" ]; then
- git archive --prefix='fixture/' --format=tar ${gittag}:fixture/ \
- | bzip2 > "$pwd"/fixture-${tag}.tar.bz2
-fi
-if [ -d "examples" ]; then
- git archive --prefix='examples/' --format=tar ${gittag}:examples/ \
- | bzip2 > "$pwd"/examples-${tag}.tar.bz2
-elif [ -d "example" ]; then
- git archive --prefix='example/' --format=tar ${gittag}:example/ \
- | bzip2 > "$pwd"/examples-${tag}.tar.bz2
-fi
-if [ -d "tasks" ]; then
- git archive --prefix='tasks/' --format=tar ${gittag}:tasks/ \
- | bzip2 > "$pwd"/tasks-${tag}.tar.bz2
-fi
-if [ -d "docs" ]; then
- git archive --prefix='docs/' --format=tar ${gittag}:docs/ \
- | bzip2 > "$pwd"/docs-${tag}.tar.bz2
-elif [ -d "doc" ]; then
- git archive --prefix='doc/' --format=tar ${gittag}:doc/ \
- | bzip2 > "$pwd"/docs-${tag}.tar.bz2
-fi
-if [ -d "src" ]; then
- git archive --prefix='src/' --format=tar ${gittag}:src/ \
- | bzip2 > "$pwd"/src-${tag}.tar.bz2
-elif [ -d "source" ]; then
- git archive --prefix='source/' --format=tar ${gittag}:source/ \
- | bzip2 > "$pwd"/source-${tag}.tar.bz2
-fi
-if [ -d "tools" ]; then
- git archive --prefix='tools/' --format=tar ${gittag}:tools/ \
- | bzip2 > "$pwd"/tools-${tag}.tar.bz2
-fi
-if [ -d "scripts" ]; then
- git archive --prefix='scripts/' --format=tar ${gittag}:scripts/ \
- | bzip2 > "$pwd"/scripts-${tag}.tar.bz2
-fi
-if [ -d "modules" ]; then
- git archive --prefix='modules/' --format=tar ${gittag}:modules/ \
- | bzip2 > "$pwd"/modules-${tag}.tar.bz2
-fi
-if [ -d "ts" ]; then
- git archive --prefix='ts/' --format=tar ${gittag}:ts/ \
- | bzip2 > "$pwd"/ts-${tag}.tar.bz2
-fi
-if [ -d "build" ]; then
- git archive --prefix='build/' --format=tar ${gittag}:build/ \
- | bzip2 > "$pwd"/build-${tag}.tar.bz2
-fi
-if [ -d "fixtures" ]; then
- git archive --prefix='fixtures/' --format=tar ${gittag}:fixtures/ \
- | bzip2 > "$pwd"/fixtures-${tag}.tar.bz2
-fi
-if [ -d "mocks" ]; then
- git archive --prefix='mocks/' --format=tar ${gittag}:mocks/ \
- | bzip2 > "$pwd"/mocks-${tag}.tar.bz2
-fi
-if [ -d "typings" ]; then
- git archive --prefix='typings/' --format=tar ${gittag}:typings/ \
- | bzip2 > "$pwd"/typings-${tag}.tar.bz2
-fi
-if [ -d "templates" ]; then
- git archive --prefix='templates/' --format=tar ${gittag}:templates/ \
- | bzip2 > "$pwd"/templates-${tag}.tar.bz2
-fi
-if [ -d "benchmark" ]; then
- git archive --prefix='benchmark/' --format=tar ${gittag}:benchmark/ \
- | bzip2 > "$pwd"/benchmark-${tag}.tar.bz2
-fi
-if [ -d "vendor" ]; then
- git archive --prefix='vendor/' --format=tar ${gittag}:vendor/ \
- | bzip2 > "$pwd"/vendor-${tag}.tar.bz2
-fi
-if [ -d "packages" ]; then
- git archive --prefix='packages/' --format=tar ${gittag}:packages/ \
- | bzip2 > "$pwd"/packages-${tag}.tar.bz2
-fi
-popd
diff --git a/nodejs-temp-write.spec b/nodejs-temp-write.spec
deleted file mode 100644
index 42f8421..0000000
--- a/nodejs-temp-write.spec
+++ /dev/null
@@ -1,101 +0,0 @@
-%{?nodejs_find_provides_and_requires}
-
-%global packagename temp-write
-
-# tests missing due to missing npm(ava)
-%global enable_tests 0
-
-Name: nodejs-temp-write
-Version: 3.3.0
-Release: 8%{?dist}
-Summary: Write string/buffer/stream to a random temp file
-
-License: MIT
-URL:
https://github.com/sindresorhus/temp-write
-Source0:
https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
-# The test files are not included in the npm tarball.
-# Source1 is generated by running Source10, which pulls from the upstream
-# version control repository.
-Source1: fixture-%{version}.tar.bz2
-Source2:
https://raw.githubusercontent.com/sindresorhus/%{packagename}/v%{version}...
-Source10: dl-tests.sh
-
-
-ExclusiveArch: %{nodejs_arches} noarch
-BuildArch: noarch
-
-BuildRequires: nodejs-packaging
-BuildRequires: npm(graceful-fs)
-BuildRequires: npm(is-stream)
-BuildRequires: npm(make-dir)
-BuildRequires: npm(pify)
-BuildRequires: npm(temp-dir)
-BuildRequires: npm(uuid)
-%if 0%{?enable_tests}
-BuildRequires: npm(ava)
-%endif
-
-%description
-Write string/buffer/stream to a random temp file
-
-
-%prep
-%autosetup -n package
-# setup the tests
-%autosetup -T -D -a 1 -n package
-cp -p %{SOURCE2} .
-
-%nodejs_fixdep uuid
-
-%build
-# nothing to do!
-
-%install
-mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
-cp -pr package.json index.js \
- %{buildroot}%{nodejs_sitelib}/%{packagename}
-
-%nodejs_symlink_deps
-
-%check
-%nodejs_symlink_deps --check
-%{__nodejs} -e 'require("./")'
-%if 0%{?enable_tests}
-%{_bindir}/ava
-%else
-%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
-%endif
-
-%files
-%doc readme.md
-%license license
-%{nodejs_sitelib}/%{packagename}
-
-%changelog
-* Sat Aug 01 2020 Fedora Release Engineering <releng(a)fedoraproject.org> - 3.3.0-8
-- Second attempt - Rebuilt for
-
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
-
-* Tue Jul 28 2020 Fedora Release Engineering <releng(a)fedoraproject.org> - 3.3.0-7
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
-
-* Wed Jan 29 2020 Fedora Release Engineering <releng(a)fedoraproject.org> - 3.3.0-6
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
-
-* Thu Jul 25 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 3.3.0-5
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
-
-* Fri Feb 01 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 3.3.0-4
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
-
-* Fri Jul 13 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 3.3.0-3
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
-
-* Thu Feb 08 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 3.3.0-2
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
-
-* Wed Sep 20 2017 Jared Smith <jsmith(a)fedoraproject.org> - 3.3.0-1
-- Update to upstream 3.3.0 release
-
-* Sat May 6 2017 Jared Smith <jsmith(a)fedoraproject.org> - 3.2.0-1
-- Initial packaging
diff --git a/sources b/sources
deleted file mode 100644
index 8b3e91d..0000000
--- a/sources
+++ /dev/null
@@ -1,2 +0,0 @@
-SHA512 (fixture-3.3.0.tar.bz2) =
cf79dca844b99d7add91c9ec9a60ba4996bc7745eca51dde7fd76148cd378146330253808a36ea98d82b311bf1cf0ea910bb9e28cc620b831a3c0060fa9e6639
-SHA512 (temp-write-3.3.0.tgz) =
7ca92208e2d2557d0392098c314537149fb9b2acb093f35ad1dadab61638077a0ef611faa885592cc0145237f96838043d12a99800292807e55ca8f3ae160bc7
diff --git a/test.js b/test.js
deleted file mode 100644
index 42c2c42..0000000
--- a/test.js
+++ /dev/null
@@ -1,465 +0,0 @@
-import path from 'path';
-import fs from 'fs';
-import stream from 'stream';
-import childProcess from 'child_process';
-import test from 'ava';
-import getStream from 'get-stream';
-import isRunning from 'is-running';
-import delay from 'delay';
-import tempfile from 'tempfile';
-import m from './';
-
-process.env.PATH = path.join(__dirname, 'fixtures') + path.delimiter +
process.env.PATH;
-process.env.FOO = 'foo';
-
-test('execa()', async t => {
- const {stdout} = await m('noop', ['foo']);
- t.is(stdout, 'foo');
-});
-
-test('buffer', async t => {
- const {stdout} = await m('noop', ['foo'], {encoding: null});
- t.true(Buffer.isBuffer(stdout));
- t.is(stdout.toString(), 'foo');
-});
-
-test('execa.stdout()', async t => {
- const stdout = await m.stdout('noop', ['foo']);
- t.is(stdout, 'foo');
-});
-
-test('execa.stderr()', async t => {
- const stderr = await m.stderr('noop-err', ['foo']);
- t.is(stderr, 'foo');
-});
-
-test('stdout/stderr available on errors', async t => {
- const err = await t.throws(m('exit', ['2']));
- t.is(typeof err.stdout, 'string');
- t.is(typeof err.stderr, 'string');
-});
-
-test('include stdout and stderr in errors for improved debugging', async t =>
{
- const err = await t.throws(m('fixtures/error-message.js'));
- t.regex(err.message, /stdout/);
- t.regex(err.message, /stderr/);
- t.is(err.code, 1);
-});
-
-test('do not include in errors when `stdio` is set to `inherit`', async t =>
{
- const err = await t.throws(m('fixtures/error-message.js', {stdio:
'inherit'}));
- t.notRegex(err.message, /\n/);
-});
-
-test('do not include `stderr` and `stdout` in errors when set to `inherit`',
async t => {
- const err = await t.throws(m('fixtures/error-message.js', {stdout:
'inherit', stderr: 'inherit'}));
- t.notRegex(err.message, /\n/);
-});
-
-test('do not include `stderr` and `stdout` in errors when `stdio` is set to
`inherit`', async t => {
- const err = await t.throws(m('fixtures/error-message.js', {stdio: [null,
'inherit', 'inherit']}));
- t.notRegex(err.message, /\n/);
-});
-
-test('do not include `stdout` in errors when set to `inherit`', async t => {
- const err = await t.throws(m('fixtures/error-message.js', {stdout:
'inherit'}));
- t.notRegex(err.message, /stdout/);
- t.regex(err.message, /stderr/);
-});
-
-test('do not include `stderr` in errors when set to `inherit`', async t => {
- const err = await t.throws(m('fixtures/error-message.js', {stderr:
'inherit'}));
- t.regex(err.message, /stdout/);
- t.notRegex(err.message, /stderr/);
-});
-
-test('pass `stdout` to a file descriptor', async t => {
- const file = tempfile('.txt');
- await m('fixtures/noop', ['foo bar'], {stdout: fs.openSync(file,
'w')});
- t.is(fs.readFileSync(file, 'utf8'), 'foo bar\n');
-});
-
-test('pass `stderr` to a file descriptor', async t => {
- const file = tempfile('.txt');
- await m('fixtures/noop-err', ['foo bar'], {stderr: fs.openSync(file,
'w')});
- t.is(fs.readFileSync(file, 'utf8'), 'foo bar\n');
-});
-
-test('execa.shell()', async t => {
- const {stdout} = await m.shell('node fixtures/noop foo');
- t.is(stdout, 'foo');
-});
-
-test('execa.spawn()', async t => {
- t.is(typeof m.spawn('noop').pid, 'number');
- t.is((await getStream(m.spawn('noop', ['foo']).stdout)).trim(),
'foo');
-});
-
-test('execa.sync()', t => {
- const {stdout} = m.sync('noop', ['foo']);
- t.is(stdout, 'foo');
-});
-
-test('execa.sync() throws error if written to stderr', t => {
- t.throws(() => m.sync('foo'), process.platform === 'win32' ?
/'foo' is not recognized as an internal or external command/ : 'spawnSync foo
ENOENT');
-});
-
-test('execa.shellSync()', t => {
- const {stdout} = m.shellSync('node fixtures/noop foo');
- t.is(stdout, 'foo');
-});
-
-test('stripEof option', async t => {
- const {stdout} = await m('noop', ['foo'], {stripEof: false});
- t.is(stdout, 'foo\n');
-});
-
-test.serial('preferLocal option', async t => {
- t.true((await m('cat-names')).stdout.length > 2);
-
- if (process.platform === 'win32') {
- // TODO: figure out how to make the below not hang on Windows
- return;
- }
-
- // Account for npm adding local binaries to the PATH
- const _path = process.env.PATH;
- process.env.PATH = '';
- await t.throws(m('cat-names', {preferLocal: false}), /spawn .* ENOENT/);
- process.env.PATH = _path;
-});
-
-test.serial('localDir option', async t => {
- const cwd = 'fixtures/local-dir';
- const bin = path.resolve(cwd, 'node_modules/.bin/self-path');
-
- await m('npm', ['install', '--no-package-lock'], {cwd});
-
- const {stdout} = await m(bin, {localDir: cwd});
-
- t.is(path.relative(cwd, stdout), path.normalize('node_modules/self-path'));
-});
-
-test('input option can be a String', async t => {
- const {stdout} = await m('stdin', {input: 'foobar'});
- t.is(stdout, 'foobar');
-});
-
-test('input option can be a Buffer', async t => {
- const {stdout} = await m('stdin', {input: 'testing12'});
- t.is(stdout, 'testing12');
-});
-
-test('input can be a Stream', async t => {
- const s = new stream.PassThrough();
- s.write('howdy');
- s.end();
- const {stdout} = await m('stdin', {input: s});
- t.is(stdout, 'howdy');
-});
-
-test('you can write to child.stdin', async t => {
- const child = m('stdin');
- child.stdin.end('unicorns');
- t.is((await child).stdout, 'unicorns');
-});
-
-test('input option can be a String - sync', t => {
- const {stdout} = m.sync('stdin', {input: 'foobar'});
- t.is(stdout, 'foobar');
-});
-
-test('input option can be a Buffer - sync', t => {
- const {stdout} = m.sync('stdin', {input: Buffer.from('testing12',
'utf8')});
- t.is(stdout, 'testing12');
-});
-
-test('opts.stdout:ignore - stdout will not collect data', async t => {
- const {stdout} = await m('stdin', {
- input: 'hello',
- stdio: [null, 'ignore', null]
- });
- t.is(stdout, null);
-});
-
-test('helpful error trying to provide an input stream in sync mode', t => {
- t.throws(
- () => m.sync('stdin', {input: new stream.PassThrough()}),
- /The `input` option cannot be a stream in sync mode/
- );
-});
-
-test('execa() returns a promise with kill() and pid', t => {
- const promise = m('noop', ['foo']);
- t.is(typeof promise.kill, 'function');
- t.is(typeof promise.pid, 'number');
-});
-
-test('maxBuffer affects stdout', async t => {
- await t.throws(m('max-buffer', ['stdout', '11'], {maxBuffer:
10}), /stdout maxBuffer exceeded/);
- await t.notThrows(m('max-buffer', ['stdout', '10'], {maxBuffer:
10}));
-});
-
-test('maxBuffer affects stderr', async t => {
- await t.throws(m('max-buffer', ['stderr', '13'], {maxBuffer:
12}), /stderr maxBuffer exceeded/);
- await t.notThrows(m('max-buffer', ['stderr', '12'], {maxBuffer:
12}));
-});
-
-test('skip throwing when using reject option', async t => {
- const err = await m('exit', ['2'], {reject: false});
- t.is(typeof err.stdout, 'string');
- t.is(typeof err.stderr, 'string');
-});
-
-test('execa() returns code and failed properties', async t => {
- const {code, failed} = await m('noop', ['foo']);
- const err = await t.throws(m('exit', ['2']));
- t.is(code, 0);
- t.false(failed);
- t.is(err.code, 2);
- t.true(err.failed);
-});
-
-test(`use relative path with '..' chars`, async t => {
- const pathViaParentDir = path.join('..', path.basename(__dirname),
'fixtures', 'noop');
- const {stdout} = await m(pathViaParentDir, ['foo']);
- t.is(stdout, 'foo');
-});
-
-if (process.platform !== 'win32') {
- test('execa() rejects if running non-executable', async t => {
- const cp = m('non-executable');
- await t.throws(cp);
- });
-}
-
-test('err.killed is true if process was killed directly', async t => {
- const cp = m('forever');
-
- setTimeout(() => {
- cp.kill();
- }, 100);
-
- const err = await t.throws(cp);
-
- t.true(err.killed);
-});
-
-// TODO: Should this really be the case, or should we improve on child_process?
-test('err.killed is false if process was killed indirectly', async t => {
- const cp = m('forever');
-
- setTimeout(() => {
- process.kill(cp.pid, 'SIGINT');
- }, 100);
-
- const err = await t.throws(cp);
-
- t.false(err.killed);
-});
-
-if (process.platform === 'darwin') {
- test.cb('sanity check: child_process.exec also has killed.false if killed
indirectly', t => {
- const cp = childProcess.exec('forever', err => {
- t.truthy(err);
- t.false(err.killed);
- t.end();
- });
-
- setTimeout(() => {
- process.kill(cp.pid, 'SIGINT');
- }, 100);
- });
-}
-
-if (process.platform !== 'win32') {
- test('err.signal is SIGINT', async t => {
- const cp = m('forever');
-
- setTimeout(() => {
- process.kill(cp.pid, 'SIGINT');
- }, 100);
-
- const err = await t.throws(cp);
-
- t.is(err.signal, 'SIGINT');
- });
-
- test('err.signal is SIGTERM', async t => {
- const cp = m('forever');
-
- setTimeout(() => {
- process.kill(cp.pid, 'SIGTERM');
- }, 100);
-
- const err = await t.throws(cp);
-
- t.is(err.signal, 'SIGTERM');
- });
-
- test('custom err.signal', async t => {
- const err = await t.throws(m('delay', ['3000', '0'],
{killSignal: 'SIGHUP', timeout: 1500}));
-
- t.is(err.signal, 'SIGHUP');
- });
-}
-
-test('result.signal is null for successful execution', async t => {
- t.is((await m('noop')).signal, null);
-});
-
-test('result.signal is null if process failed, but was not killed', async t =>
{
- const err = await t.throws(m('exit', [2]));
- t.is(err.signal, null);
-});
-
-async function code(t, num) {
- const err = await t.throws(m('exit', [`${num}`]));
-
- t.is(err.code, num);
-}
-
-test('err.code is 2', code, 2);
-test('err.code is 3', code, 3);
-test('err.code is 4', code, 4);
-
-test('timeout will kill the process early', async t => {
- const err = await t.throws(m('delay', ['3000', '0'], {timeout:
1500}));
-
- t.true(err.timedOut);
- t.not(err.code, 22);
-});
-
-test('timeout will not kill the process early', async t => {
- const err = await t.throws(m('delay', ['3000', '22'], {timeout:
30000}));
-
- t.false(err.timedOut);
- t.is(err.code, 22);
-});
-
-test('timedOut will be false if no timeout was set and zero exit code', async t
=> {
- const result = await m('delay', ['1000', '0']);
-
- t.false(result.timedOut);
-});
-
-test('timedOut will be false if no timeout was set and non-zero exit code', async
t => {
- const err = await t.throws(m('delay', ['1000', '3']));
-
- t.false(err.timedOut);
-});
-
-async function errorMessage(t, expected, ...args) {
- const err = await t.throws(m('exit', args));
-
- t.regex(err.message, expected);
-}
-
-errorMessage.title = (message, expected) => `err.message matches: ${expected}`;
-
-test(errorMessage, /Command failed: exit 2 foo bar/, 2, 'foo', 'bar');
-test(errorMessage, /Command failed: exit 3 baz quz/, 3, 'baz', 'quz');
-
-async function cmd(t, expected, ...args) {
- const err = await t.throws(m('fail', args));
-
- t.is(err.cmd, `fail${expected}`);
-
- const result = await m('noop', args);
-
- t.is(result.cmd, `noop${expected}`);
-}
-
-cmd.title = (message, expected) => `cmd is: ${JSON.stringify(expected)}`;
-
-test(cmd, ' foo bar', 'foo', 'bar');
-test(cmd, ' baz quz', 'baz', 'quz');
-test(cmd, '');
-
-async function spawnAndKill(t, signal, cleanup) {
- const name = cleanup ? 'sub-process' : 'sub-process-false';
- const cp = m(name);
- let pid;
-
- cp.stdout.setEncoding('utf8');
- cp.stdout.on('data', chunk => {
- pid = parseInt(chunk, 10);
- t.is(typeof pid, 'number');
-
- setTimeout(() => {
- process.kill(cp.pid, signal);
- }, 100);
- });
-
- await t.throws(cp);
-
- // Give everybody some time to breath and kill things
- await delay(200);
-
- t.false(isRunning(cp.pid));
- t.is(isRunning(pid), !cleanup);
-}
-
-test('cleanup - SIGINT', spawnAndKill, 'SIGINT', true);
-test('cleanup - SIGKILL', spawnAndKill, 'SIGTERM', true);
-
-if (process.platform !== 'win32') {
- // On Windows the subprocesses are actually always killed
- test('cleanup false - SIGINT', spawnAndKill, 'SIGTERM', false);
- test('cleanup false - SIGKILL', spawnAndKill, 'SIGKILL', false);
-}
-
-// See:
https://github.com/sindresorhus/execa/issues/56
-const onlyWinFailing = test[process.platform === 'win32' ? 'failing' :
'serial'];
-onlyWinFailing('execa.shell() supports the `shell` option', async t => {
- const {stdout} = await m.shell('noop foo', {
- shell: process.platform === 'win32' ? 'cmd.exe' : '/bin/bash'
- });
- t.is(stdout, 'foo');
-});
-
-if (process.platform !== 'win32') {
- test('write to fast-exit process', async t => {
- // Try-catch here is necessary, because this test is not 100% accurate
- // Sometimes process can manage to accept input before exiting
- try {
- await m(`fast-exit-${process.platform}`, [], {input: 'data'});
- t.pass();
- } catch (err) {
- t.is(err.code, 'EPIPE');
- }
- });
-}
-
-test('use environment variables by default', async t => {
- const result = await m.stdout('environment');
-
- t.deepEqual(result.split('\n'), [
- 'foo',
- 'undefined'
- ]);
-});
-
-test('extend environment variables by default', async t => {
- const result = await m.stdout('environment', [], {env: {BAR: 'bar'}});
-
- t.deepEqual(result.split('\n'), [
- 'foo',
- 'bar'
- ]);
-});
-
-test('do not extend environment with `envExtend` option', async t => {
- const result = await m.stdout('environment', [], {env: {BAR: 'bar',
PATH: process.env.PATH}, extendEnv: false});
-
- t.deepEqual(result.split('\n'), [
- 'undefined',
- 'bar'
- ]);
-});
-
-test('do not buffer when streaming', async t => {
- const result = await getStream(m('max-buffer', ['stdout', '21'],
{maxBuffer: 10}).stdout);
-
- t.is(result, '....................\n');
-});