@gkalpak/aliases
Advanced tools
Comparing version 0.11.1 to 0.12.0
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
console.log(stripIndentation(` | ||
### [Generated by: @gkalpak/aliases v0.11.1] | ||
### [Generated by: @gkalpak/aliases v0.12.0] | ||
### Copy the following into '~/.bashrc': | ||
@@ -8,0 +8,0 @@ |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
console.log(stripIndentation(` | ||
### [Generated by: @gkalpak/aliases v0.11.1] | ||
### [Generated by: @gkalpak/aliases v0.12.0] | ||
### Copy the following into '~/.bashrc': | ||
@@ -8,0 +8,0 @@ |
#!/usr/bin/env node | ||
import {stripIndentation} from '../../lib/utils.js'; | ||
console.log(stripIndentation(` | ||
### [Generated by: @gkalpak/aliases v0.11.1] | ||
### [Generated by: @gkalpak/aliases v0.12.0] | ||
### Run the following commands: | ||
@@ -6,0 +6,0 @@ |
#!/usr/bin/env node | ||
import {stripIndentation} from '../../lib/utils.js'; | ||
console.log(stripIndentation(` | ||
### [Generated by: @gkalpak/aliases v0.11.1] | ||
### [Generated by: @gkalpak/aliases v0.12.0] | ||
### Run the following commands: | ||
@@ -6,0 +6,0 @@ |
#!/usr/bin/env node | ||
import {stripIndentation} from '../../lib/utils.js'; | ||
console.log(stripIndentation(` | ||
### [Generated by: @gkalpak/aliases v0.11.1] | ||
### [Generated by: @gkalpak/aliases v0.12.0] | ||
### Run the following commands: | ||
@@ -6,0 +6,0 @@ |
#!/usr/bin/env node | ||
import {stripIndentation} from '../../lib/utils.js'; | ||
console.log(stripIndentation(` | ||
### [Generated by: @gkalpak/aliases v0.11.1] | ||
### [Generated by: @gkalpak/aliases v0.12.0] | ||
### Copy the following into '~/.gnupg/gpg-agent.conf': | ||
@@ -6,0 +6,0 @@ |
#!/usr/bin/env node | ||
import {stripIndentation} from '../../lib/utils.js'; | ||
console.log(stripIndentation(` | ||
### [Generated by: @gkalpak/aliases v0.11.1] | ||
### [Generated by: @gkalpak/aliases v0.12.0] | ||
### Copy the following into '~/.ssh/config': | ||
@@ -6,0 +6,0 @@ |
@@ -5,4 +5,4 @@ #!/usr/bin/env node | ||
const __dirname = fileURLToPath(new URL('.', import.meta.url)); | ||
console.log('""" [Generated by: @gkalpak/aliases v0.11.1]'); | ||
console.log('""" [Generated by: @gkalpak/aliases v0.12.0]'); | ||
console.log('""" Copy the following into \'~/.vimrc\':\n'); | ||
console.log(readFileSync(`${__dirname}/../../lib/assets/vimrc.txt`, 'utf8').trim() + '\n'); |
#!/usr/bin/env node | ||
import {stripIndentation} from '../../lib/utils.js'; | ||
console.log(stripIndentation(` | ||
### [Generated by: @gkalpak/aliases v0.11.1] | ||
### [Generated by: @gkalpak/aliases v0.12.0] | ||
### Copy the following into a root-owned, 600-mode '/etc/resolv.conf' file: | ||
@@ -17,3 +17,3 @@ | ||
### [Generated by: @gkalpak/aliases v0.11.1] | ||
### [Generated by: @gkalpak/aliases v0.12.0] | ||
### Copy the following into a root-owned, 600-mode '/etc/wsl.conf' file: | ||
@@ -20,0 +20,0 @@ |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
// eslint-disable-next-line max-len | ||
const cmd = '(git show-ref --heads --quiet master && echo master) || (git show-ref --heads --quiet main && echo main) || echo unknown-branch'; | ||
const cmd = 'node --print "const rem = \'origin\'; const exec = cmd => child_process.execSync(cmd, {encoding: \'utf8\', stdio: \'pipe\'}); try { exec(\'git rev-parse --abbrev-ref \' + rem + \'/HEAD\').slice(rem.length + 1); } catch { exec([\'main\', \'master\'].map(b => \'(git show-ref --heads --quiet \' + b + \' && echo \' + b + \')\').join(\' || \') + \' || echo unknown-branch\'); }"'; | ||
export default cmd; | ||
@@ -8,0 +8,0 @@ if (isMain(import.meta.url)) { |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
// eslint-disable-next-line max-len | ||
const cmd = 'git checkout ${1:::(git show-ref --heads --quiet master && echo master) || (git show-ref --heads --quiet main && echo main) || echo unknown-branch} && git pull upstream ${1:::(git show-ref --heads --quiet master && echo master) || (git show-ref --heads --quiet main && echo main) || echo unknown-branch} && git push origin ${1:::(git show-ref --heads --quiet master && echo master) || (git show-ref --heads --quiet main && echo main) || echo unknown-branch}'; | ||
const cmd = 'git checkout ${1:::node --print "const rem = \'origin\'; const exec = cmd => child_process.execSync(cmd, {encoding: \'utf8\', stdio: \'pipe\'}); try { exec(\'git rev-parse --abbrev-ref \' + rem + \'/HEAD\').slice(rem.length + 1); } catch { exec([\'main\', \'master\'].map(b => \'(git show-ref --heads --quiet \' + b + \' && echo \' + b + \')\').join(\' || \') + \' || echo unknown-branch\'); }"} && git pull upstream ${1:::node --print "const rem = \'origin\'; const exec = cmd => child_process.execSync(cmd, {encoding: \'utf8\', stdio: \'pipe\'}); try { exec(\'git rev-parse --abbrev-ref \' + rem + \'/HEAD\').slice(rem.length + 1); } catch { exec([\'main\', \'master\'].map(b => \'(git show-ref --heads --quiet \' + b + \' && echo \' + b + \')\').join(\' || \') + \' || echo unknown-branch\'); }"} && git push origin ${1:::node --print "const rem = \'origin\'; const exec = cmd => child_process.execSync(cmd, {encoding: \'utf8\', stdio: \'pipe\'}); try { exec(\'git rev-parse --abbrev-ref \' + rem + \'/HEAD\').slice(rem.length + 1); } catch { exec([\'main\', \'master\'].map(b => \'(git show-ref --heads --quiet \' + b + \' && echo \' + b + \')\').join(\' || \') + \' || echo unknown-branch\'); }"}'; | ||
export default cmd; | ||
@@ -8,0 +8,0 @@ if (isMain(import.meta.url)) { |
#!/usr/bin/env node | ||
console.log('@gkalpak/aliases v0.11.1'); | ||
console.log('@gkalpak/aliases v0.12.0'); |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
// eslint-disable-next-line max-len | ||
const cmd = 'node --eval "/* NVM update instructions */ (async () => { try { const currentVersion = require(\'child_process\').execSync(\'nvm version\', {encoding: \'utf8\', shell: true}).trim(); const latestVersion = await new Promise((resolve, reject) => require(\'https\').get(\'https://api.github.com/repos/coreybutler/nvm-windows/tags?per_page=1\', {headers: {\'User-Agent\': \'Node.js\'}}, res => { let responseText = \'\'; res.on(\'data\', d => responseText += d).on(\'error\', reject).on(\'end\', () => resolve(JSON.parse(responseText)[0].name.replace(/^v/, \'\'))); }).on(\'error\', reject).end()); const message = (currentVersion === latestVersion) ? \'Already up to date.\' : \'Update available.\'; const escapedInstructionsTmpl = \'Download, unzip and run: https://github.com/coreybutler/nvm-windows/releases/download/{{version}}/nvm-setup.zip\'; console.log(\'Current version: \' + currentVersion); console.log(\'Latest version: \' + latestVersion); console.log(\'\\n \' + message); console.log(\'\\nUpdate instructions (https://github.com/coreybutler/nvm-windows#installation--upgrades):\'); console.log(\' \' + escapedInstructionsTmpl.split(\'{{version}}\').join(latestVersion)); } catch (err) { console.error(\'ERROR:\', err); process.exit(1); } })();"'; | ||
const cmd = 'node --eval "/* NVM update instructions */ (async () => { try { const currentVersion = require(\'child_process\').execSync(\'nvm version\', {encoding: \'utf8\', shell: true}).trim(); const latestVersion = await new Promise((resolve, reject) => require(\'https\').get(\'https://api.github.com/repos/coreybutler/nvm-windows/tags?per_page=1\', {headers: {\'User-Agent\': \'Node.js\'}}, res => { let responseText = \'\'; res.on(\'data\', d => responseText += d).on(\'error\', reject).on(\'end\', () => resolve(JSON.parse(responseText)[0].name.replace(/^v/, \'\'))); }).on(\'error\', reject).end()); const message = (currentVersion === latestVersion) ? \'Already up to date.\' : \'Update available.\'; const escapedInstructionsTmpl = \'Download and run: https://github.com/coreybutler/nvm-windows/releases/download/{{version}}/nvm-setup.exe\'; console.log(\'Current version: \' + currentVersion); console.log(\'Latest version: \' + latestVersion); console.log(\'\\n \' + message); console.log(\'\\nUpdate instructions (https://github.com/coreybutler/nvm-windows#installation--upgrades):\'); console.log(\' \' + escapedInstructionsTmpl.split(\'{{version}}\').join(latestVersion)); } catch (err) { console.error(\'ERROR:\', err); process.exit(1); } })();"'; | ||
export default cmd; | ||
@@ -8,0 +8,0 @@ if (isMain(import.meta.url)) { |
@@ -22,4 +22,15 @@ // Imports | ||
const GIT_GET_DEFAULT_BRANCH_CMD = | ||
`${['master', 'main'].map(b => `(git show-ref --heads --quiet ${b} && echo ${b})`).join(' || ')} || ` + | ||
'echo unknown-branch'; | ||
stripIndentation(` | ||
node --print " | ||
const rem = 'origin'; | ||
const exec = cmd => child_process.execSync(cmd, {encoding: 'utf8', stdio: 'pipe'}); | ||
try { | ||
exec('git rev-parse --abbrev-ref ' + rem + '/HEAD').slice(rem.length + 1); | ||
} catch { | ||
exec(['main', 'master']. | ||
map(b => '(git show-ref --heads --quiet ' + b + ' && echo ' + b + ')'). | ||
join(' || ') + | ||
' || echo unknown-branch'); | ||
}" | ||
`).replace(/([;{+])(\n)/g, '$1 $2').replace(/\n\s*/g, ''); | ||
const GLOBAL_NPM_PACKAGES = [ | ||
@@ -268,3 +279,3 @@ '@angular/cli', | ||
gco: new AliasDefault('git checkout ${*:::__g-pick-branch --gkcu-returnOutput=1}'), | ||
gcom: new AliasDefault(`git checkout \${0:::${GIT_GET_DEFAULT_BRANCH_CMD}} $*`), | ||
gcod: new AliasDefault(`git checkout \${0:::${GIT_GET_DEFAULT_BRANCH_CMD}} $*`), | ||
gcopr: new AliasDefault('git fetch upstream pull/$1/head && git checkout FETCH_HEAD'), | ||
@@ -305,3 +316,3 @@ gcoghpr: SCRIPT_BACKED_ALIAS('gcoghpr', 'Check out a GitHub pull request as a local branch.'), | ||
gbc: new AliasDefault(GIT_CREATE_BRANCH_CMD('${2:HEAD}')), | ||
gbcm: new AliasDefault(GIT_CREATE_BRANCH_CMD(`\${0:::${GIT_GET_DEFAULT_BRANCH_CMD}}`)), | ||
gbcd: new AliasDefault(GIT_CREATE_BRANCH_CMD(`\${0:::${GIT_GET_DEFAULT_BRANCH_CMD}}`)), | ||
gbco: new AliasDefault(`git fetch origin $1 && ${GIT_CREATE_BRANCH_CMD('origin/$1')}`), | ||
@@ -313,5 +324,5 @@ gbd: new AliasDefault('git branch --delete --force ${*:::__g-pick-branch --gkcu-returnOutput=1}'), | ||
gpro: new AliasDefault('git pull --rebase origin ${*:::git rev-parse --abbrev-ref HEAD}'), | ||
gprom: new AliasDefault(`git pull --rebase origin \${0:::${GIT_GET_DEFAULT_BRANCH_CMD}} $*`), | ||
gprod: new AliasDefault(`git pull --rebase origin \${0:::${GIT_GET_DEFAULT_BRANCH_CMD}} $*`), | ||
gpru: new AliasDefault('git pull --rebase upstream ${*:::git rev-parse --abbrev-ref HEAD}'), | ||
gprum: new AliasDefault(`git pull --rebase upstream \${0:::${GIT_GET_DEFAULT_BRANCH_CMD}} $*`), | ||
gprud: new AliasDefault(`git pull --rebase upstream \${0:::${GIT_GET_DEFAULT_BRANCH_CMD}} $*`), | ||
@@ -327,8 +338,8 @@ // SYNC DEFAULT BRANCH | ||
grb: new AliasDefault('git rebase ${*:::__g-pick-branch --gkcu-returnOutput=1}'), | ||
grbm: new AliasDefault(`git rebase --ignore-date \${0:::${GIT_GET_DEFAULT_BRANCH_CMD}} $*`), | ||
grba: new AliasDefault('git rebase --abort'), | ||
grbc: new AliasDefault('git rebase --continue'), | ||
grbd: new AliasDefault(`git rebase --ignore-date \${0:::${GIT_GET_DEFAULT_BRANCH_CMD}} $*`), | ||
grbi: new AliasDefault('git rebase --interactive HEAD~$1'), | ||
grbia: new AliasDefault('git rebase --autosquash --interactive HEAD~$1'), | ||
grbin: new AliasDefault('git rebase --no-autosquash --interactive HEAD~$1'), | ||
grbc: new AliasDefault('git rebase --continue'), | ||
grba: new AliasDefault('git rebase --abort'), | ||
gmt: new AliasDefault('git mergetool'), | ||
@@ -411,4 +422,4 @@ gcl: new AliasDefault('git clean --interactive "${0:::git rev-parse --show-toplevel}"'), | ||
'installation--upgrades', | ||
'Download, unzip and run: ' + | ||
'https://github.com/coreybutler/nvm-windows/releases/download/{{version}}/nvm-setup.zip', | ||
'Download and run: ' + | ||
'https://github.com/coreybutler/nvm-windows/releases/download/{{version}}/nvm-setup.exe', | ||
), | ||
@@ -415,0 +426,0 @@ ), |
{ | ||
"name": "@gkalpak/aliases", | ||
"version": "0.11.1", | ||
"version": "0.12.0", | ||
"description": "My global aliases.", | ||
@@ -57,3 +57,3 @@ "keywords": [ | ||
"gbc": "./bin/git/gbc.js", | ||
"gbcm": "./bin/git/gbcm.js", | ||
"gbcd": "./bin/git/gbcd.js", | ||
"gbco": "./bin/git/gbco.js", | ||
@@ -75,5 +75,5 @@ "gbd": "./bin/git/gbd.js", | ||
"gco": "./bin/git/gco.js", | ||
"gcod": "./bin/git/gcod.js", | ||
"gcoghpr": "./bin/git/gcoghpr.js", | ||
"gcoghpr-cleanup": "./bin/git/gcoghpr-cleanup.js", | ||
"gcom": "./bin/git/gcom.js", | ||
"gcopr": "./bin/git/gcopr.js", | ||
@@ -103,12 +103,12 @@ "gcp": "./bin/git/gcp.js", | ||
"gpro": "./bin/git/gpro.js", | ||
"gprom": "./bin/git/gprom.js", | ||
"gprod": "./bin/git/gprod.js", | ||
"gpru": "./bin/git/gpru.js", | ||
"gprum": "./bin/git/gprum.js", | ||
"gprud": "./bin/git/gprud.js", | ||
"grb": "./bin/git/grb.js", | ||
"grba": "./bin/git/grba.js", | ||
"grbc": "./bin/git/grbc.js", | ||
"grbd": "./bin/git/grbd.js", | ||
"grbi": "./bin/git/grbi.js", | ||
"grbia": "./bin/git/grbia.js", | ||
"grbin": "./bin/git/grbin.js", | ||
"grbm": "./bin/git/grbm.js", | ||
"grs": "./bin/git/grs.js", | ||
@@ -115,0 +115,0 @@ "grs1": "./bin/git/grs1.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
180182
3669
4