Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rfc: drop support for < Node 10 #204

Merged
merged 8 commits into from
Apr 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .jshintrc

This file was deleted.

1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
.jshintrc
.editorconfig
test
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ language: node_js
node_js:
- node
- lts/*
- 8

before_install:
- sudo apt-get update -qq
Expand Down
27 changes: 14 additions & 13 deletions bin/httpsnippet
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

'use strict'

var chalk = require('chalk')
var cmd = require('commander')
var fs = require('fs')
var readFile = require('fs-readfile-promise')
var writeFile = require('fs-writefile-promise')
var HTTPSnippet = require('..')
var path = require('path')
var pkg = require('../package.json')
const chalk = require('chalk')
const cmd = require('commander')
const fs = require('fs')
const readFile = require('fs-readfile-promise')
const writeFile = require('fs-writefile-promise')
const HTTPSnippet = require('..')
const path = require('path')
const pkg = require('../package.json')

cmd
.version(pkg.version)
Expand All @@ -23,16 +23,17 @@ if (!cmd.args.length || !cmd.target) {
cmd.help()
}

let dir
if (cmd.output) {
var dir = path.resolve(cmd.output)
dir = path.resolve(cmd.output)

if (!fs.existsSync(dir)) {
fs.mkdirSync(dir)
}
}

cmd.args.forEach(function (fileName) {
var file = path.basename(fileName)
const file = path.basename(fileName)

readFile(fileName)
.then(JSON.parse)
Expand All @@ -57,7 +58,7 @@ cmd.args.forEach(function (fileName) {

.then(function (output) {
if (!output) {
var targetNames = HTTPSnippet.availableTargets().map(function (t) { return t.key }).join(', ')
const targetNames = HTTPSnippet.availableTargets().map(function (t) { return t.key }).join(', ')
return console.error('%s %s is not a valid target. Valid targets: %s', chalk.red('✖'), chalk.red(cmd.target), chalk.cyan(targetNames))
}

Expand All @@ -67,9 +68,9 @@ cmd.args.forEach(function (fileName) {
}

// write to file
var name = path.basename(file, path.extname(file))
const name = path.basename(file, path.extname(file))

var filename = path.format({
const filename = path.format({
dir: dir,
base: name + HTTPSnippet.extname(cmd.target)
})
Expand Down
Loading