!1 package init

Merge pull request !1 from jackie_wu123/master
This commit is contained in:
openeuler-ci-bot 2020-08-24 17:17:07 +08:00 committed by Gitee
commit bfc233aa08
4 changed files with 108 additions and 0 deletions

BIN
mkdirp-0.5.1.tgz Normal file

Binary file not shown.

View File

@ -0,0 +1,60 @@
commit 0cd6cd55664b5979fd546d6f9ae1fbf383a6eaed
Author: Tom Hughes <tom@compton.nu>
Date: Mon Feb 6 09:35:46 2017 +0000
Adjust tests for mockfs 4.x changes
diff --git a/test/opts_fs.js b/test/opts_fs.js
index 97186b6..0e9f8ee 100644
--- a/test/opts_fs.js
+++ b/test/opts_fs.js
@@ -2,6 +2,7 @@ var mkdirp = require('../');
var path = require('path');
var test = require('tap').test;
var mockfs = require('mock-fs');
+var xfs = require('fs');
var _0777 = parseInt('0777', 8);
var _0755 = parseInt('0755', 8);
@@ -12,9 +13,11 @@ test('opts.fs', function (t) {
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
- var file = '/beep/boop/' + [x,y,z].join('/');
- var xfs = mockfs.fs();
-
+ var file = 'beep/boop/' + [x,y,z].join('/');
+
+ mockfs();
+ t.tearDown(mockfs.restore);
+
mkdirp(file, { fs: xfs, mode: _0755 }, function (err) {
t.ifError(err);
xfs.exists(file, function (ex) {
diff --git a/test/opts_fs_sync.js b/test/opts_fs_sync.js
index 6c370aa..b8cf63a 100644
--- a/test/opts_fs_sync.js
+++ b/test/opts_fs_sync.js
@@ -2,6 +2,7 @@ var mkdirp = require('../');
var path = require('path');
var test = require('tap').test;
var mockfs = require('mock-fs');
+var xfs = require('fs');
var _0777 = parseInt('0777', 8);
var _0755 = parseInt('0755', 8);
@@ -12,9 +13,11 @@ test('opts.fs sync', function (t) {
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
- var file = '/beep/boop/' + [x,y,z].join('/');
- var xfs = mockfs.fs();
-
+ var file = 'beep/boop/' + [x,y,z].join('/');
+
+ mockfs();
+ t.tearDown(mockfs.restore);
+
mkdirp.sync(file, { fs: xfs, mode: _0755 });
xfs.exists(file, function (ex) {
t.ok(ex, 'created file');

44
nodejs-mkdirp.spec Normal file
View File

@ -0,0 +1,44 @@
%{?nodejs_find_provides_and_requires}
%global enable_tests 0
Name: nodejs-mkdirp
Version: 0.5.1
Release: 1
Summary: Recursive directory creation module for Node.js
License: MIT
URL: https://github.com/substack/node-mkdirp
Source0: https://registry.npmjs.org/mkdirp/-/mkdirp-%{version}.tgz
Patch0: nodejs-mkdirp-mockfs4.patch
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(tap) npm(mock-fs) >= 4.0.0
%endif
%description
Creates directories recursively, like `mkdir -p`.
%prep
%autosetup -p 1 -n package
%nodejs_fixdep minimist "^1.2.0"
%build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/mkdirp
cp -pr index.js package.json %{buildroot}%{nodejs_sitelib}/mkdirp
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%__tap test/*.js
%endif
%files
%doc readme.markdown examples
%license LICENSE
%{nodejs_sitelib}/mkdirp
%changelog
* Mon Aug 17 2020 wutao <wutao61@huawei.com> - 0.5.1-1
- Package init

4
nodejs-mkdirp.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: substack/node-mkdirp
tag_prefix: "^"
seperator: "."