From c29bffb8654afcee94311f7df17ff30cada6f166 Mon Sep 17 00:00:00 2001 From: wangxiao65 <287608437@qq.com> Date: Tue, 1 Sep 2020 13:55:00 +0800 Subject: [PATCH 1/3] package init --- LICENSE | 18 ++++++++++++++++ has-color-0.1.7.tgz | Bin 0 -> 986 bytes nodejs-has-color.spec | 47 ++++++++++++++++++++++++++++++++++++++++++ nodejs-has-color.yaml | 5 +++++ test.js | 30 +++++++++++++++++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 LICENSE create mode 100644 has-color-0.1.7.tgz create mode 100644 nodejs-has-color.spec create mode 100644 nodejs-has-color.yaml create mode 100644 test.js diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c9b44cb --- /dev/null +++ b/LICENSE @@ -0,0 +1,18 @@ +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. diff --git a/has-color-0.1.7.tgz b/has-color-0.1.7.tgz new file mode 100644 index 0000000000000000000000000000000000000000..adf244f5e1e8ad15b55721bc0755f86f4eed34ad GIT binary patch literal 986 zcmV<0110<)iwFP!000001MOGcZre5#&TaG*C&^IR!z{~o>;MVe4NG?sAVq-2y%>xJ zrln(vjYO&><;0l%Kzofn*+|Ng>?}<)tnF6J=SKYb&JT~skB1ovZb^jgtoVBGC1-n| zS$y9g93O-Eo(%f->vxO3mQK$UO0srAe&R2V3@i&4cW zfPg}gQbrPxd6sdZBy5;WXn;&wXRj|t#hAd1ORBh7m|;m-C{S_{=d%4EAd;(Cw@<-D zy%G1d)q!iPWTAQzQ$mx67JrJ&s2A|Ggyq75Vx_Xvc6$?RQ5v+ezL7PMv-s=Ns0Pif|78iG1gd3PT8S75I)f3g~ z%fC?1GRYIHx(O|tgvqKc)xv~S+E9zKDWYlF?Dhv0JjSH*aBp1J?$VU7u$AbXRp??r zR1lJpDNShYB(z(pUVe!4SD2wr3k&FG>We(;gnn<6>8zZ8`xt$*vgZAEx%s|?k5BNw z-}7t!_Xj7M|GS-&&W``ThPb&zkV?=%xo1ww!#qI`?+fA{LSvS*z)(Fjn)>wZ(-|}} z!2^`iBO;o6cHdmh8g8q_c)`_f6Ap$$XmzZ{zCe`=1~ZaKJahI}&eK+&Frh^Lm<6dq zo-26q0uHu^JSs<{U!N64mJl`LB88!L>)uh;>$*?*cF(UauilJ)dGp!@%AhoZZ2p{x zHOw=*g|{$Ir|y$cwr}*6g2snjt7e#>fH?7}lvaK;q_~UmNZ@sfBwTEw}=I-*?$xe2%lmEW_34%+A IAOIEs0D-Ff#{d8T literal 0 HcmV?d00001 diff --git a/nodejs-has-color.spec b/nodejs-has-color.spec new file mode 100644 index 0000000..69714ae --- /dev/null +++ b/nodejs-has-color.spec @@ -0,0 +1,47 @@ +%{?nodejs_find_provides_and_requires} +%global enable_tests 1 +Name: nodejs-has-color +Version: 0.1.7 +Release: 1 +Summary: Detects whether a terminal supports color +License: MIT +URL: https://github.com/sindresorhus/has-color +Source0: http://registry.npmjs.org/has-color/-/has-color-%{version}.tgz +Source1: https://raw.githubusercontent.com/sindresorhus/has-color/ab671b1f74846d9fb9caea8dc302603a865be3cc/test.js +#https://opensource.org.licenses/MIT +Source2: LICENSE +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +BuildRequires: nodejs-packaging +%if 0%{?enable_tests} +BuildRequires: npm(mocha) +%endif +%description +%{summary}. + +%prep +%setup -q -n package +cp -p %{SOURCE1} . +cp -p %{SOURCE2} . + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/has-color +cp -pr package.json index.js \ + %{buildroot}%{nodejs_sitelib}/has-color +%nodejs_symlink_deps +%if 0%{?enable_tests} + +%check +%nodejs_symlink_deps --check +/usr/bin/mocha +%endif + +%files +%doc LICENSE readme.md +%{nodejs_sitelib}/has-color + +%changelog +* Thu Aug 20 2020 wangxiao - 0.1.7-1 +- Package init diff --git a/nodejs-has-color.yaml b/nodejs-has-color.yaml new file mode 100644 index 0000000..34e6e7b --- /dev/null +++ b/nodejs-has-color.yaml @@ -0,0 +1,5 @@ +git_url: https://github.com/sindresorhus/has-color +version_control: github +src_repo: sindresorhus/has-color +tag_prefix: "^v" +seperator: "." diff --git a/test.js b/test.js new file mode 100644 index 0000000..752fc15 --- /dev/null +++ b/test.js @@ -0,0 +1,30 @@ +'use strict'; +var assert = require('assert'); + +beforeEach(function () { + // clear the cache of the tested module + delete require.cache[require.resolve('./index')]; + process.stdout.isTTY = true; + process.argv = []; + process.env = {}; +}); + +it('should return false if not TTY', function () { + process.stdout.isTTY = false; + assert.equal(require('./index'), false); +}); + +it('should return false if --no-color flag is used', function () { + process.argv = ['--no-color']; + assert.equal(require('./index'), false); +}); + +it('should return true if --color flag is used', function () { + process.argv = ['--color']; + assert.equal(require('./index'), true); +}); + +it('should return true if `COLORTERM` is in env', function () { + process.env.COLORTERM = true; + assert.equal(require('./index'), true); +}); From f077292cf963cf94d2730b34e40c639c9858d3de Mon Sep 17 00:00:00 2001 From: wangxiao65 <287608437@qq.com> Date: Thu, 3 Sep 2020 17:22:58 +0800 Subject: [PATCH 2/3] modify Source --- has-color-0.1.7.tgz | Bin 986 -> 0 bytes nodejs-has-color-0.1.7.tar.gz | Bin 0 -> 1775 bytes nodejs-has-color.spec | 13 +++++++------ test.js | 30 ------------------------------ 4 files changed, 7 insertions(+), 36 deletions(-) delete mode 100644 has-color-0.1.7.tgz create mode 100644 nodejs-has-color-0.1.7.tar.gz delete mode 100644 test.js diff --git a/has-color-0.1.7.tgz b/has-color-0.1.7.tgz deleted file mode 100644 index adf244f5e1e8ad15b55721bc0755f86f4eed34ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 986 zcmV<0110<)iwFP!000001MOGcZre5#&TaG*C&^IR!z{~o>;MVe4NG?sAVq-2y%>xJ zrln(vjYO&><;0l%Kzofn*+|Ng>?}<)tnF6J=SKYb&JT~skB1ovZb^jgtoVBGC1-n| zS$y9g93O-Eo(%f->vxO3mQK$UO0srAe&R2V3@i&4cW zfPg}gQbrPxd6sdZBy5;WXn;&wXRj|t#hAd1ORBh7m|;m-C{S_{=d%4EAd;(Cw@<-D zy%G1d)q!iPWTAQzQ$mx67JrJ&s2A|Ggyq75Vx_Xvc6$?RQ5v+ezL7PMv-s=Ns0Pif|78iG1gd3PT8S75I)f3g~ z%fC?1GRYIHx(O|tgvqKc)xv~S+E9zKDWYlF?Dhv0JjSH*aBp1J?$VU7u$AbXRp??r zR1lJpDNShYB(z(pUVe!4SD2wr3k&FG>We(;gnn<6>8zZ8`xt$*vgZAEx%s|?k5BNw z-}7t!_Xj7M|GS-&&W``ThPb&zkV?=%xo1ww!#qI`?+fA{LSvS*z)(Fjn)>wZ(-|}} z!2^`iBO;o6cHdmh8g8q_c)`_f6Ap$$XmzZ{zCe`=1~ZaKJahI}&eK+&Frh^Lm<6dq zo-26q0uHu^JSs<{U!N64mJl`LB88!L>)uh;>$*?*cF(UauilJ)dGp!@%AhoZZ2p{x zHOw=*g|{$Ir|y$cwr}*6g2snjt7e#>fH?7}lvaK;q_~UmNZ@sfBwTEw}=I-*?$xe2%lmEW_34%+A IAOIEs0D-Ff#{d8T diff --git a/nodejs-has-color-0.1.7.tar.gz b/nodejs-has-color-0.1.7.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a5ac91a942d84526aefad532ebcafdb22e9b39d2 GIT binary patch literal 1775 zcmVPEZ3=h8x_v0np}?Ab7>v}R zrIXB7B3+Vlk~R53`y2aZJ4%)NVQ*aj!duw(mP%+h>dYL8a5F zkXqGz5er#sculWg-?I%95B+}k`uNA|jreaj?sfO<$5!0&_}}{eJqVZ<(ic2rdm!PQ z|2x;d|8}pn{{H)|2Ih;;H@zEo{QW;5<#+7~898R8WI(h`!EuHUPaMVr%nu`_FJdqc z=-2@sj6^t!88?zRbo>dG3QW6HhqcF!mMj@*Ng1j{qq7Oqpr+J^qGQGtNIeP}$I64l z*}SK@QPg}#Bk4YMO;YOi;dm!-(8RYUKcsR#{ZWG7XgeC z5u`CFO8|Ed+vESOnlP@VzaJaB;=j}1$p1aFC$RDVCl;T$Vh-8((Tjk7uj~qg3#Ki^CaKDR{ zZm|tp)ZIh1-O_BNuK}Qr%t{R@GyOvH9-cX5~keO zOmI@E608+iNGek)d{D~6WIXe-rSdAQxV0J=`66=7F0-k+q+GE} z{~|)CFR^Ax&+E+7p!9~d>UFNITD_`Ps!uKB-w|x(|MKzs9&GI5|8}FlasG?{E&tyF zK46)5$ZN)`q;! z8fB{Z5E9(Ot@rqIWTc)il0pr4t=Z7Eo*vcfW!+2*m98?|z$3;%m5k@R=EG+LQzLtg zrD{GuB~?SmMl})sgf8_$7H1s}bFHH4G72Y|!aKM)6EZ02EGJ`rldjy!#psK-uzbpu z$TrCNZOn>GlRt{<>=WCv4}DQw%4l3%wz|EA`UK*Ig)B8K%_RxtLCt*DTWII&VWC2& zbd0;~rI8?8O3UE~F#8pzV2%lVR-XEN9&th+W|R4yY{kC{w(`FO8YJK)!G3J);(x>W z8|Q!a`~R)r0aq}-nj z5~`34s-M0Fts--F17N3#HtgYE|sg zdGLU|;J6^-*l|uzPsdbEoF53ECTJ)VlUhyD87wEwsO1g+R9G@)&E6_!My1htp1Ct1 z65gjwLd9LQbFs#DOl@CiWySfNrM*~075Dg>p_`^xx!o6LYf2Xxk|M&39^8YPh_58=s7FFgiv&y8EOESh9LntKtM*Ye9 z$xyvc{1~vkp&}m@fQWET&X^5?IVn2_0mMl1MekmwIxOxCkHj;y>E(xzZuR7;bFl4L zXa2`xrKjd338lkw3*bid;mRCq7{b*RS4~8UIj(%@L6C^K&;+}6ACa|zU1PjBqsb@7 zL;q=9Sxni&{YSZCb+-dczRswcFh$H~s_Pvp##=smJK2LrW?FNH{--ye;EJ)e+mqA9 zY1^rB1d~3#*Xvy|2VRR7%XRW8&V22#w6L(Su&}VOu&}VOu&}VOu&}VOu&}VOu&}VO Ru(0?f{0B$gU~K?U003mbp349L literal 0 HcmV?d00001 diff --git a/nodejs-has-color.spec b/nodejs-has-color.spec index 69714ae..16e8c33 100644 --- a/nodejs-has-color.spec +++ b/nodejs-has-color.spec @@ -1,15 +1,17 @@ %{?nodejs_find_provides_and_requires} %global enable_tests 1 +%global packagename supports-color + Name: nodejs-has-color Version: 0.1.7 Release: 1 Summary: Detects whether a terminal supports color License: MIT -URL: https://github.com/sindresorhus/has-color -Source0: http://registry.npmjs.org/has-color/-/has-color-%{version}.tgz -Source1: https://raw.githubusercontent.com/sindresorhus/has-color/ab671b1f74846d9fb9caea8dc302603a865be3cc/test.js +URL: https://github.com/chalk/supports-color +#https://codeload.github.com/chalk/supports-color/tar.gz/v0.1.7 +Source0: %{name}-%{version}.tar.gz #https://opensource.org.licenses/MIT -Source2: LICENSE +Source1: LICENSE BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging @@ -20,9 +22,8 @@ BuildRequires: npm(mocha) %{summary}. %prep -%setup -q -n package +%setup -q -n %{packagename}-%{version} cp -p %{SOURCE1} . -cp -p %{SOURCE2} . %build diff --git a/test.js b/test.js deleted file mode 100644 index 752fc15..0000000 --- a/test.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; -var assert = require('assert'); - -beforeEach(function () { - // clear the cache of the tested module - delete require.cache[require.resolve('./index')]; - process.stdout.isTTY = true; - process.argv = []; - process.env = {}; -}); - -it('should return false if not TTY', function () { - process.stdout.isTTY = false; - assert.equal(require('./index'), false); -}); - -it('should return false if --no-color flag is used', function () { - process.argv = ['--no-color']; - assert.equal(require('./index'), false); -}); - -it('should return true if --color flag is used', function () { - process.argv = ['--color']; - assert.equal(require('./index'), true); -}); - -it('should return true if `COLORTERM` is in env', function () { - process.env.COLORTERM = true; - assert.equal(require('./index'), true); -}); From 894bea70d8d6d903cd7987c934450af7d1944586 Mon Sep 17 00:00:00 2001 From: wangxiao65 <287608437@qq.com> Date: Mon, 7 Sep 2020 17:28:46 +0800 Subject: [PATCH 3/3] package init --- nodejs-has-color.spec | 3 +-- nodejs-has-color-0.1.7.tar.gz => v0.1.7.tar.gz | Bin 2 files changed, 1 insertion(+), 2 deletions(-) rename nodejs-has-color-0.1.7.tar.gz => v0.1.7.tar.gz (100%) diff --git a/nodejs-has-color.spec b/nodejs-has-color.spec index 16e8c33..edeb776 100644 --- a/nodejs-has-color.spec +++ b/nodejs-has-color.spec @@ -8,8 +8,7 @@ Release: 1 Summary: Detects whether a terminal supports color License: MIT URL: https://github.com/chalk/supports-color -#https://codeload.github.com/chalk/supports-color/tar.gz/v0.1.7 -Source0: %{name}-%{version}.tar.gz +Source0: https://github.com/chalk/supports-color/archive/v%{version}.tar.gz #https://opensource.org.licenses/MIT Source1: LICENSE BuildArch: noarch diff --git a/nodejs-has-color-0.1.7.tar.gz b/v0.1.7.tar.gz similarity index 100% rename from nodejs-has-color-0.1.7.tar.gz rename to v0.1.7.tar.gz