mirror of
https://github.com/satwikkansal/wtfpython
synced 2024-11-22 02:54:25 +01:00
Remove every existence of npm
This commit is contained in:
parent
a7471ca737
commit
264b93a633
10
.npmignore
vendored
10
.npmignore
vendored
@ -1,10 +0,0 @@
|
||||
.DS_Store
|
||||
.idea/
|
||||
|
||||
irrelevant/
|
||||
wtfpython-pypi/**
|
||||
|
||||
# Python-specific byte-compiled files should be ignored
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
41
package.json
vendored
41
package.json
vendored
@ -1,41 +0,0 @@
|
||||
{
|
||||
"name": "wtfpython",
|
||||
"version": "2.2.2",
|
||||
"description": "A collection of surprising Python snippets and lesser known features. [ARCHIVED]",
|
||||
"bin": "wtfpython",
|
||||
"scripts": {
|
||||
"postpublish": "git push origin master",
|
||||
"toc": "doctoc --github --title '# Table of Contents' --maxlevel 3 README.md"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/satwikkansal/wtfPython.git"
|
||||
},
|
||||
"keywords": [
|
||||
"python",
|
||||
"specification",
|
||||
"notes",
|
||||
"wtf",
|
||||
"learning",
|
||||
"guide",
|
||||
"handbook"
|
||||
],
|
||||
"author": "Satwik Kansal <satwikkansal@gmail.com> (https://satwikkansal.xyz)",
|
||||
"license": "WTFPL 2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/satwikkansal/wtfPython/issues"
|
||||
},
|
||||
"homepage": "https://github.com/satwikkansal/wtfPython#readme",
|
||||
"devDependencies": {
|
||||
"doctoc": "^1.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"boxen": "^1.1.0",
|
||||
"chalk": "^1.1.1",
|
||||
"default-pager": "^1.1.0",
|
||||
"meow": "^3.7.0",
|
||||
"msee": "^0.3.3",
|
||||
"through2": "^2.0.2",
|
||||
"update-notifier": "^2.0.0"
|
||||
}
|
||||
}
|
85
wtfpython
vendored
85
wtfpython
vendored
@ -1,85 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const fs = require('fs');
|
||||
const obj = require('through2').obj;
|
||||
const pager = require('default-pager');
|
||||
const msee = require('msee');
|
||||
const join = require('path').join;
|
||||
const boxen = require('boxen');
|
||||
const chalk = require('chalk');
|
||||
const updateNotifier = require('update-notifier');
|
||||
const pkg = require('./package.json');
|
||||
const meow = require('meow');
|
||||
|
||||
const cli = meow([
|
||||
'Usage',
|
||||
' bash-handbook',
|
||||
'',
|
||||
'Options',
|
||||
' --lang, -l Translation language',
|
||||
'',
|
||||
'Examples',
|
||||
' bash-handbook',
|
||||
' bash-handbook --lang pt-br'
|
||||
], {
|
||||
string: [
|
||||
'lang'
|
||||
],
|
||||
alias: {
|
||||
l: 'lang',
|
||||
h: 'help'
|
||||
},
|
||||
default: {
|
||||
lang: ''
|
||||
}
|
||||
});
|
||||
|
||||
const boxenOpts = {
|
||||
borderColor: 'yellow',
|
||||
margin: {
|
||||
bottom: 1
|
||||
},
|
||||
padding: {
|
||||
right: 1,
|
||||
left: 1
|
||||
}
|
||||
};
|
||||
|
||||
const mseeOpts = {
|
||||
paragraphEnd: '\n\n'
|
||||
};
|
||||
|
||||
const notifier = updateNotifier({ pkg });
|
||||
|
||||
process.env.PAGER = process.env.PAGER || 'less';
|
||||
process.env.LESS = process.env.LESS || 'FRX';
|
||||
|
||||
const lang = cli.flags.lang
|
||||
.toLowerCase()
|
||||
.split('-')
|
||||
.map((l, i) => i === 0 ? l : l.toUpperCase())
|
||||
.join('-');
|
||||
|
||||
const translation = join(__dirname, !lang ? './README.md' : `./README-${lang}.md`);
|
||||
|
||||
fs.stat(translation, function (err, stats) {
|
||||
if (err) {
|
||||
console.log('The %s translation does not exist', chalk.bold(lang));
|
||||
return;
|
||||
}
|
||||
|
||||
fs.createReadStream(translation)
|
||||
.pipe(obj(function (chunk, enc, cb) {
|
||||
const message = [];
|
||||
|
||||
if (notifier.update) {
|
||||
message.push(`Update available: {green.bold ${notifier.update.latest}} {dim current: ${notifier.update.current}}`);
|
||||
message.push(`Run {blue npm install -g ${pkg.name}} to update.`);
|
||||
this.push(boxen(message.join('\n'), boxenOpts));
|
||||
}
|
||||
|
||||
this.push(msee.parse(chunk.toString(), mseeOpts));
|
||||
cb();
|
||||
}))
|
||||
.pipe(pager());
|
||||
});
|
Loading…
Reference in New Issue
Block a user