Merge branch 'develop' into stable
This commit is contained in:
commit
5d0c3bcfb0
12562 changed files with 1024587 additions and 32 deletions
7
.gitattributes
vendored
7
.gitattributes
vendored
|
@ -1,5 +1,2 @@
|
||||||
# Auto detect text files and perform LF normalization
|
Force LF endings
|
||||||
* text=auto
|
* eol=lf
|
||||||
|
|
||||||
# Conform to PSR-12 coding standard
|
|
||||||
*.php eol=lf
|
|
||||||
|
|
23
.gitignore
vendored
23
.gitignore
vendored
|
@ -1,15 +1,16 @@
|
||||||
/vendor/*
|
/vendor/bin
|
||||||
!/vendor/autoload.php
|
/vendor/composer
|
||||||
!/vendor/embed
|
/vendor/squizlabs/php_codesniffer
|
||||||
!/vendor/embed/embed
|
/vendor/dealerdirect/phpcodesniffer-composer-installer
|
||||||
!/vendor/laminas
|
|
||||||
!/vendor/laminas/laminas-diactoros
|
|
||||||
!/vendor/grandel
|
|
||||||
!/vendor/grandel/include-directory
|
|
||||||
|
|
||||||
/node_modules/*
|
/node_modules/.bin
|
||||||
!/node_modules/jquery
|
/node_modules/errno
|
||||||
!/node_modules/fomantic-ui
|
/node_modules/image-size
|
||||||
|
/node_modules/make-dir
|
||||||
|
/node_modules/mime
|
||||||
|
/node_modules/needle
|
||||||
|
/node_modules/prr
|
||||||
|
/node_modules/sax
|
||||||
|
|
||||||
/.vscode
|
/.vscode
|
||||||
/includes/config/config.php
|
/includes/config/config.php
|
||||||
|
|
23
README.md
23
README.md
|
@ -21,17 +21,26 @@ Use at your own risk.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
Install dependencies
|
Install dependencies
|
||||||
```
|
|
||||||
composer install
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
### Composer
|
||||||
npm install
|
- `composer install`
|
||||||
```
|
- `composer install --dev`
|
||||||
|
- `composer install --no-dev`
|
||||||
|
|
||||||
|
### NPM
|
||||||
|
Use one of the following commands.
|
||||||
|
|
||||||
|
- `npm install`
|
||||||
|
- `npm install --only=development`
|
||||||
|
- `npm install --only=production --no-optional`
|
||||||
|
|
||||||
### Theme changes
|
### Theme changes
|
||||||
```
|
```
|
||||||
cd semantic
|
cd semantic
|
||||||
gulp build
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
And then one of the following commands:
|
||||||
|
- `gulp build`
|
||||||
|
- `gulp watch`
|
||||||
|
|
||||||
For more information see: https://fomantic-ui.com/introduction/build-tools.html
|
For more information see: https://fomantic-ui.com/introduction/build-tools.html
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
"require": {
|
"require": {
|
||||||
"embed/embed": "^4.3",
|
"embed/embed": "^4.3",
|
||||||
"laminas/laminas-diactoros": "^2.8",
|
"laminas/laminas-diactoros": "^2.8",
|
||||||
"grandel/include-directory": "^0.2.2"
|
"grandel/include-directory": "^0.2.2",
|
||||||
|
"knplabs/github-api": "^3.0",
|
||||||
|
"guzzlehttp/guzzle": "^7.0.1",
|
||||||
|
"http-interop/http-factory-guzzle": "^1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1358
composer.lock
generated
1358
composer.lock
generated
File diff suppressed because it is too large
Load diff
12
create-release.ps1
Normal file
12
create-release.ps1
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
Write-Host "second string"
|
||||||
|
|
||||||
|
$Version = Read-Host "What version would you like to release?"
|
||||||
|
|
||||||
|
$VersionRegEx = "define\('VERSION', '([\d\.]+)'\);"
|
||||||
|
|
||||||
|
$IndexPHP = (Get-Content -Path .\index.php -Raw) -Replace $VersionRegEx, "`define('VERSION', '$Version');" | Set-Content -Path .\index.php
|
||||||
|
|
||||||
|
IEX 'composer update --no-dev --with-all-dependencies --ignore-platform-req=php'
|
||||||
|
IEX 'npm update --only=production --no-optional'
|
||||||
|
|
||||||
|
Read-Host
|
|
@ -132,6 +132,9 @@ class Wishlist
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="extra content">
|
<div class="extra content">
|
||||||
|
<?php if ($info->url) { ?>
|
||||||
|
<a class="ui tiny button" href="<?= $info->url ?>" target="_blank">View</a>
|
||||||
|
<?php } ?>
|
||||||
<?php if ($this->data['user'] === $_SESSION['user']['id']) { ?>
|
<?php if ($this->data['user'] === $_SESSION['user']['id']) { ?>
|
||||||
<a class="ui tiny red button delete">Delete</a>
|
<a class="ui tiny red button delete">Delete</a>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|
28
includes/functions/deleteDirectory.php
Normal file
28
includes/functions/deleteDirectory.php
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a directory with all of its contents.
|
||||||
|
*
|
||||||
|
* @author Jay Trees <github.jay@grandel.anonaddy.me>
|
||||||
|
*/
|
||||||
|
|
||||||
|
function delete_directory(string $directoryToDelete)
|
||||||
|
{
|
||||||
|
foreach (scandir($directoryToDelete) as $filename) {
|
||||||
|
if (in_array($filename, array('.', '..'))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$filepath = $directoryToDelete . '/' . $filename;
|
||||||
|
|
||||||
|
if (is_file($filepath) && !is_dir($filepath)) {
|
||||||
|
unlink($filepath);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_dir($filepath)) {
|
||||||
|
delete_directory($filepath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rmdir($directoryToDelete);
|
||||||
|
}
|
|
@ -16,6 +16,48 @@ $page->navigation();
|
||||||
* Update
|
* Update
|
||||||
*/
|
*/
|
||||||
if ('POST' === $_SERVER['REQUEST_METHOD']) {
|
if ('POST' === $_SERVER['REQUEST_METHOD']) {
|
||||||
|
/**
|
||||||
|
* Files
|
||||||
|
*/
|
||||||
|
$zip_filename = __DIR__ . '/' . $tag . '.zip';
|
||||||
|
|
||||||
|
/** Download */
|
||||||
|
file_put_contents(
|
||||||
|
$zip_filename,
|
||||||
|
file_get_contents('https://github.com/grandeljay/wishthis/archive/refs/tags/' . $tag . '.zip')
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Decompress */
|
||||||
|
$zip = new ZipArchive();
|
||||||
|
|
||||||
|
if ($zip->open($zip_filename)) {
|
||||||
|
$zip->extractTo(__DIR__);
|
||||||
|
$zip->close();
|
||||||
|
|
||||||
|
$directory_wishthis_github = __DIR__ . '/wishthis-' . $version;
|
||||||
|
|
||||||
|
foreach (scandir($directory_wishthis_github) as $filename) {
|
||||||
|
if (in_array($filename, array('.', '..', 'config'))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$filepath = __DIR__ . '/' . $filename;
|
||||||
|
$filepath_github = $directory_wishthis_github . '/' . $filename;
|
||||||
|
|
||||||
|
if (is_dir($filepath) && is_dir($filepath_github)) {
|
||||||
|
delete_directory($filepath);
|
||||||
|
}
|
||||||
|
|
||||||
|
rename($filepath_github, $filepath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Delete */
|
||||||
|
unlink($zip_filename);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Database
|
||||||
|
*/
|
||||||
/** Current version is below 0.2.0 */
|
/** Current version is below 0.2.0 */
|
||||||
if (-1 === version_compare($options->version, '0.2.0')) {
|
if (-1 === version_compare($options->version, '0.2.0')) {
|
||||||
$database->query('ALTER TABLE `users`
|
$database->query('ALTER TABLE `users`
|
||||||
|
@ -33,7 +75,7 @@ if ('POST' === $_SERVER['REQUEST_METHOD']) {
|
||||||
;');
|
;');
|
||||||
$database->query('ALTER TABLE `wishlists` ADD INDEX(`hash`);');
|
$database->query('ALTER TABLE `wishlists` ADD INDEX(`hash`);');
|
||||||
|
|
||||||
$database->query('INSERT INTO `options` (`key`, `value`) VALUES ("version", "' . VERSION . '");');
|
$database->query('INSERT INTO `options` (`key`, `value`) VALUES ("version", "' . $version . '");');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Current version is below 0.3.0 */
|
/** Current version is below 0.3.0 */
|
||||||
|
@ -44,7 +86,7 @@ if ('POST' === $_SERVER['REQUEST_METHOD']) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Update version */
|
/** Update version */
|
||||||
$options->setOption('version', VERSION);
|
$options->setOption('version', $version);
|
||||||
|
|
||||||
header('Location: /?page=home');
|
header('Location: /?page=home');
|
||||||
die();
|
die();
|
||||||
|
@ -57,8 +99,7 @@ if ('POST' === $_SERVER['REQUEST_METHOD']) {
|
||||||
|
|
||||||
<div class="ui segment">
|
<div class="ui segment">
|
||||||
<h2 class="ui header">New version detected</h2>
|
<h2 class="ui header">New version detected</h2>
|
||||||
<p>Thank you for updating to <strong>v<?= VERSION ?></strong>!</p>
|
<p>An update is available. If you are brave, please click the button to start the self updater.</p>
|
||||||
<p>There have been some changes in the database, please run the updater.</p>
|
|
||||||
<div class="ui icon warning message">
|
<div class="ui icon warning message">
|
||||||
<i class="exclamation triangle icon"></i>
|
<i class="exclamation triangle icon"></i>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
@ -71,10 +112,16 @@ if ('POST' === $_SERVER['REQUEST_METHOD']) {
|
||||||
<form class="ui form" method="post">
|
<form class="ui form" method="post">
|
||||||
<button class="ui orange button" type="submit">
|
<button class="ui orange button" type="submit">
|
||||||
<i class="upload icon"></i>
|
<i class="upload icon"></i>
|
||||||
Run the updater
|
Update to v<?= $version ?>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="ui segment">
|
||||||
|
<h2 class="ui header">Changes</h2>
|
||||||
|
|
||||||
|
<?= str_replace(PHP_EOL, '<br>', $release['body']) ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
11
index.php
11
index.php
|
@ -6,6 +6,8 @@
|
||||||
* @author Jay Trees <github.jay@grandel.anonaddy.me>
|
* @author Jay Trees <github.jay@grandel.anonaddy.me>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
define('VERSION', '0.3.0');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include
|
* Include
|
||||||
*/
|
*/
|
||||||
|
@ -77,10 +79,15 @@ if ($options) {
|
||||||
/**
|
/**
|
||||||
* Update
|
* Update
|
||||||
*/
|
*/
|
||||||
define('VERSION', '0.3.0');
|
use Github\Client;
|
||||||
|
|
||||||
if ($options) {
|
if ($options) {
|
||||||
if (-1 === version_compare($options->version, VERSION)) {
|
$client = new Client();
|
||||||
|
$release = $client->api('repo')->releases()->latest('grandeljay', 'wishthis');
|
||||||
|
$tag = $release['tag_name'];
|
||||||
|
$version = str_replace('v', '', $tag);
|
||||||
|
|
||||||
|
if (-1 === version_compare($options->version, $version)) {
|
||||||
$options->updateAvailable = true;
|
$options->updateAvailable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
12
node_modules/.bin/atob
generated
vendored
Normal file
12
node_modules/.bin/atob
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../atob/bin/atob.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../atob/bin/atob.js" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/atob.cmd
generated
vendored
Normal file
17
node_modules/.bin/atob.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\atob\bin\atob.js" %*
|
28
node_modules/.bin/atob.ps1
generated
vendored
Normal file
28
node_modules/.bin/atob.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../atob/bin/atob.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../atob/bin/atob.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../atob/bin/atob.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../atob/bin/atob.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/autoprefixer
generated
vendored
Normal file
12
node_modules/.bin/autoprefixer
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../autoprefixer/bin/autoprefixer" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../autoprefixer/bin/autoprefixer" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/autoprefixer.cmd
generated
vendored
Normal file
17
node_modules/.bin/autoprefixer.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\autoprefixer\bin\autoprefixer" %*
|
28
node_modules/.bin/autoprefixer.ps1
generated
vendored
Normal file
28
node_modules/.bin/autoprefixer.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../autoprefixer/bin/autoprefixer" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../autoprefixer/bin/autoprefixer" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../autoprefixer/bin/autoprefixer" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../autoprefixer/bin/autoprefixer" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/browserslist
generated
vendored
Normal file
12
node_modules/.bin/browserslist
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../browserslist/cli.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../browserslist/cli.js" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/browserslist.cmd
generated
vendored
Normal file
17
node_modules/.bin/browserslist.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\browserslist\cli.js" %*
|
28
node_modules/.bin/browserslist.ps1
generated
vendored
Normal file
28
node_modules/.bin/browserslist.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../browserslist/cli.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../browserslist/cli.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/color-support
generated
vendored
Normal file
12
node_modules/.bin/color-support
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../color-support/bin.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../color-support/bin.js" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/color-support.cmd
generated
vendored
Normal file
17
node_modules/.bin/color-support.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\color-support\bin.js" %*
|
28
node_modules/.bin/color-support.ps1
generated
vendored
Normal file
28
node_modules/.bin/color-support.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../color-support/bin.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../color-support/bin.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../color-support/bin.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../color-support/bin.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/css-beautify
generated
vendored
Normal file
12
node_modules/.bin/css-beautify
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../js-beautify/js/bin/css-beautify.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../js-beautify/js/bin/css-beautify.js" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/css-beautify.cmd
generated
vendored
Normal file
17
node_modules/.bin/css-beautify.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\js-beautify\js\bin\css-beautify.js" %*
|
28
node_modules/.bin/css-beautify.ps1
generated
vendored
Normal file
28
node_modules/.bin/css-beautify.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../js-beautify/js/bin/css-beautify.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../js-beautify/js/bin/css-beautify.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../js-beautify/js/bin/css-beautify.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../js-beautify/js/bin/css-beautify.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/editorconfig
generated
vendored
Normal file
12
node_modules/.bin/editorconfig
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../editorconfig/bin/editorconfig" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../editorconfig/bin/editorconfig" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/editorconfig.cmd
generated
vendored
Normal file
17
node_modules/.bin/editorconfig.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\editorconfig\bin\editorconfig" %*
|
28
node_modules/.bin/editorconfig.ps1
generated
vendored
Normal file
28
node_modules/.bin/editorconfig.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../editorconfig/bin/editorconfig" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../editorconfig/bin/editorconfig" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../editorconfig/bin/editorconfig" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../editorconfig/bin/editorconfig" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/findup
generated
vendored
Normal file
12
node_modules/.bin/findup
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../@choojs/findup/bin/findup.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../@choojs/findup/bin/findup.js" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/findup.cmd
generated
vendored
Normal file
17
node_modules/.bin/findup.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@choojs\findup\bin\findup.js" %*
|
28
node_modules/.bin/findup.ps1
generated
vendored
Normal file
28
node_modules/.bin/findup.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../@choojs/findup/bin/findup.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../@choojs/findup/bin/findup.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../@choojs/findup/bin/findup.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../@choojs/findup/bin/findup.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/gulp
generated
vendored
Normal file
12
node_modules/.bin/gulp
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../gulp/bin/gulp.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../gulp/bin/gulp.js" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/gulp.cmd
generated
vendored
Normal file
17
node_modules/.bin/gulp.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\gulp\bin\gulp.js" %*
|
28
node_modules/.bin/gulp.ps1
generated
vendored
Normal file
28
node_modules/.bin/gulp.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../gulp/bin/gulp.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../gulp/bin/gulp.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../gulp/bin/gulp.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../gulp/bin/gulp.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/html-beautify
generated
vendored
Normal file
12
node_modules/.bin/html-beautify
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../js-beautify/js/bin/html-beautify.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../js-beautify/js/bin/html-beautify.js" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/html-beautify.cmd
generated
vendored
Normal file
17
node_modules/.bin/html-beautify.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\js-beautify\js\bin\html-beautify.js" %*
|
28
node_modules/.bin/html-beautify.ps1
generated
vendored
Normal file
28
node_modules/.bin/html-beautify.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../js-beautify/js/bin/html-beautify.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../js-beautify/js/bin/html-beautify.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../js-beautify/js/bin/html-beautify.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../js-beautify/js/bin/html-beautify.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/js-beautify
generated
vendored
Normal file
12
node_modules/.bin/js-beautify
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../js-beautify/js/bin/js-beautify.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../js-beautify/js/bin/js-beautify.js" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/js-beautify.cmd
generated
vendored
Normal file
17
node_modules/.bin/js-beautify.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\js-beautify\js\bin\js-beautify.js" %*
|
28
node_modules/.bin/js-beautify.ps1
generated
vendored
Normal file
28
node_modules/.bin/js-beautify.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../js-beautify/js/bin/js-beautify.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../js-beautify/js/bin/js-beautify.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../js-beautify/js/bin/js-beautify.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../js-beautify/js/bin/js-beautify.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/json2yaml
generated
vendored
Normal file
12
node_modules/.bin/json2yaml
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../yamljs/bin/json2yaml" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../yamljs/bin/json2yaml" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/json2yaml.cmd
generated
vendored
Normal file
17
node_modules/.bin/json2yaml.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\yamljs\bin\json2yaml" %*
|
28
node_modules/.bin/json2yaml.ps1
generated
vendored
Normal file
28
node_modules/.bin/json2yaml.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../yamljs/bin/json2yaml" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../yamljs/bin/json2yaml" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../yamljs/bin/json2yaml" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../yamljs/bin/json2yaml" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/lessc
generated
vendored
Normal file
12
node_modules/.bin/lessc
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../less/bin/lessc" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../less/bin/lessc" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/lessc.cmd
generated
vendored
Normal file
17
node_modules/.bin/lessc.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\less\bin\lessc" %*
|
28
node_modules/.bin/lessc.ps1
generated
vendored
Normal file
28
node_modules/.bin/lessc.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../less/bin/lessc" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../less/bin/lessc" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../less/bin/lessc" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../less/bin/lessc" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/mkdirp
generated
vendored
Normal file
12
node_modules/.bin/mkdirp
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../mkdirp/bin/cmd.js" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/mkdirp.cmd
generated
vendored
Normal file
17
node_modules/.bin/mkdirp.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mkdirp\bin\cmd.js" %*
|
28
node_modules/.bin/mkdirp.ps1
generated
vendored
Normal file
28
node_modules/.bin/mkdirp.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/nopt
generated
vendored
Normal file
12
node_modules/.bin/nopt
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../nopt/bin/nopt.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../nopt/bin/nopt.js" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/nopt.cmd
generated
vendored
Normal file
17
node_modules/.bin/nopt.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nopt\bin\nopt.js" %*
|
28
node_modules/.bin/nopt.ps1
generated
vendored
Normal file
28
node_modules/.bin/nopt.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../nopt/bin/nopt.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../nopt/bin/nopt.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../nopt/bin/nopt.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../nopt/bin/nopt.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/resolve
generated
vendored
Normal file
12
node_modules/.bin/resolve
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../resolve/bin/resolve" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../resolve/bin/resolve" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/resolve.cmd
generated
vendored
Normal file
17
node_modules/.bin/resolve.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\resolve\bin\resolve" %*
|
28
node_modules/.bin/resolve.ps1
generated
vendored
Normal file
28
node_modules/.bin/resolve.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../resolve/bin/resolve" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../resolve/bin/resolve" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/rimraf
generated
vendored
Normal file
12
node_modules/.bin/rimraf
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../rimraf/bin.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../rimraf/bin.js" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/rimraf.cmd
generated
vendored
Normal file
17
node_modules/.bin/rimraf.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\rimraf\bin.js" %*
|
28
node_modules/.bin/rimraf.ps1
generated
vendored
Normal file
28
node_modules/.bin/rimraf.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../rimraf/bin.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../rimraf/bin.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/rtlcss
generated
vendored
Normal file
12
node_modules/.bin/rtlcss
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../rtlcss/bin/rtlcss.js" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../rtlcss/bin/rtlcss.js" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/rtlcss.cmd
generated
vendored
Normal file
17
node_modules/.bin/rtlcss.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\rtlcss\bin\rtlcss.js" %*
|
28
node_modules/.bin/rtlcss.ps1
generated
vendored
Normal file
28
node_modules/.bin/rtlcss.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../rtlcss/bin/rtlcss.js" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../rtlcss/bin/rtlcss.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../rtlcss/bin/rtlcss.js" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../rtlcss/bin/rtlcss.js" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/semver
generated
vendored
Normal file
12
node_modules/.bin/semver
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../semver/bin/semver" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../semver/bin/semver" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/semver.cmd
generated
vendored
Normal file
17
node_modules/.bin/semver.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver" %*
|
28
node_modules/.bin/semver.ps1
generated
vendored
Normal file
28
node_modules/.bin/semver.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../semver/bin/semver" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../semver/bin/semver" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../semver/bin/semver" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/uglifyjs
generated
vendored
Normal file
12
node_modules/.bin/uglifyjs
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../uglify-js/bin/uglifyjs" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../uglify-js/bin/uglifyjs" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/uglifyjs.cmd
generated
vendored
Normal file
17
node_modules/.bin/uglifyjs.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\uglify-js\bin\uglifyjs" %*
|
28
node_modules/.bin/uglifyjs.ps1
generated
vendored
Normal file
28
node_modules/.bin/uglifyjs.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../uglify-js/bin/uglifyjs" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../uglify-js/bin/uglifyjs" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../uglify-js/bin/uglifyjs" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../uglify-js/bin/uglifyjs" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/which
generated
vendored
Normal file
12
node_modules/.bin/which
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../which/bin/which" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../which/bin/which" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/which.cmd
generated
vendored
Normal file
17
node_modules/.bin/which.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\which\bin\which" %*
|
28
node_modules/.bin/which.ps1
generated
vendored
Normal file
28
node_modules/.bin/which.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../which/bin/which" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../which/bin/which" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../which/bin/which" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../which/bin/which" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
12
node_modules/.bin/yaml2json
generated
vendored
Normal file
12
node_modules/.bin/yaml2json
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||||
|
|
||||||
|
case `uname` in
|
||||||
|
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -x "$basedir/node" ]; then
|
||||||
|
exec "$basedir/node" "$basedir/../yamljs/bin/yaml2json" "$@"
|
||||||
|
else
|
||||||
|
exec node "$basedir/../yamljs/bin/yaml2json" "$@"
|
||||||
|
fi
|
17
node_modules/.bin/yaml2json.cmd
generated
vendored
Normal file
17
node_modules/.bin/yaml2json.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@ECHO off
|
||||||
|
GOTO start
|
||||||
|
:find_dp0
|
||||||
|
SET dp0=%~dp0
|
||||||
|
EXIT /b
|
||||||
|
:start
|
||||||
|
SETLOCAL
|
||||||
|
CALL :find_dp0
|
||||||
|
|
||||||
|
IF EXIST "%dp0%\node.exe" (
|
||||||
|
SET "_prog=%dp0%\node.exe"
|
||||||
|
) ELSE (
|
||||||
|
SET "_prog=node"
|
||||||
|
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||||
|
)
|
||||||
|
|
||||||
|
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\yamljs\bin\yaml2json" %*
|
28
node_modules/.bin/yaml2json.ps1
generated
vendored
Normal file
28
node_modules/.bin/yaml2json.ps1
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env pwsh
|
||||||
|
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||||
|
|
||||||
|
$exe=""
|
||||||
|
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||||
|
# Fix case when both the Windows and Linux builds of Node
|
||||||
|
# are installed in the same directory
|
||||||
|
$exe=".exe"
|
||||||
|
}
|
||||||
|
$ret=0
|
||||||
|
if (Test-Path "$basedir/node$exe") {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "$basedir/node$exe" "$basedir/../yamljs/bin/yaml2json" $args
|
||||||
|
} else {
|
||||||
|
& "$basedir/node$exe" "$basedir/../yamljs/bin/yaml2json" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
} else {
|
||||||
|
# Support pipeline input
|
||||||
|
if ($MyInvocation.ExpectingInput) {
|
||||||
|
$input | & "node$exe" "$basedir/../yamljs/bin/yaml2json" $args
|
||||||
|
} else {
|
||||||
|
& "node$exe" "$basedir/../yamljs/bin/yaml2json" $args
|
||||||
|
}
|
||||||
|
$ret=$LASTEXITCODE
|
||||||
|
}
|
||||||
|
exit $ret
|
7196
node_modules/.package-lock.json
generated
vendored
Normal file
7196
node_modules/.package-lock.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
5
node_modules/@choojs/findup/.travis.yml
generated
vendored
Normal file
5
node_modules/@choojs/findup/.travis.yml
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- "stable"
|
||||||
|
- "8"
|
||||||
|
- "6"
|
144
node_modules/@choojs/findup/README.md
generated
vendored
Normal file
144
node_modules/@choojs/findup/README.md
generated
vendored
Normal file
|
@ -0,0 +1,144 @@
|
||||||
|
[![build status](https://secure.travis-ci.org/choojs/findup.png)](http://travis-ci.org/choojs/findup)
|
||||||
|
@choojs/findup
|
||||||
|
=======
|
||||||
|
|
||||||
|
> This is a fork of [Filirom1/findup](https://github.com/Filirom1/findup), pending [#16](https://github.com/Filirom1/findup/pull/16).
|
||||||
|
|
||||||
|
### Install
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install -g @choojs/findup
|
||||||
|
```
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
Find up a file in ancestor's dir
|
||||||
|
|
||||||
|
|
||||||
|
.
|
||||||
|
├── config.json
|
||||||
|
└── f
|
||||||
|
└── e
|
||||||
|
└── d
|
||||||
|
└── c
|
||||||
|
├── b
|
||||||
|
│ └── a
|
||||||
|
└── config.json
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
- `maxdepth`: (Number, default -1) How far to traverse before giving up. If maxdepth is `-1`, then there is no limit.
|
||||||
|
|
||||||
|
#### Async
|
||||||
|
|
||||||
|
findup(dir, fileName, options, callback)
|
||||||
|
findup(dir, iterator, options, callback) with `iterator(dir, cb)` where cb only accept `true` or `false`
|
||||||
|
|
||||||
|
```js
|
||||||
|
var findup = require('@choojs/findup');
|
||||||
|
|
||||||
|
|
||||||
|
findup(__dirname + '/f/e/d/c/b/a', 'config.json', function(err, dir){
|
||||||
|
// if(e) e === new Error('not found')
|
||||||
|
// dir === '/f/e/d/c'
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```js
|
||||||
|
findup(__dirname + '/f/e/d/c/b/a', function(dir, cb){
|
||||||
|
require('path').exists(dir + '/config.json', cb);
|
||||||
|
}, function(err, dir){
|
||||||
|
// if(e) e === new Error('not found')
|
||||||
|
// dir === '/f/e/d/c'
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
#### EventEmitter
|
||||||
|
|
||||||
|
findup(dir, fileName, options)
|
||||||
|
|
||||||
|
```js
|
||||||
|
var findup = require('@choojs/findup');
|
||||||
|
var fup = findup(__dirname + '/f/e/d/c/b/a', 'config.json');
|
||||||
|
```
|
||||||
|
|
||||||
|
findup(dir, iterator, options) with `iterator(dir, cb)` where cb only accept `true` or `false`
|
||||||
|
|
||||||
|
```js
|
||||||
|
var findup = require('@choojs/findup');
|
||||||
|
var fup = findup(__dirname + '/f/e/d/c/b/a', function(dir, cb){
|
||||||
|
require('path').exists(dir + '/config.json', cb);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
findup return an EventEmitter. 3 events are emitted: `found`, `error`, `end`
|
||||||
|
|
||||||
|
`found` event is emitted each time a file is found.
|
||||||
|
|
||||||
|
You can stop the traversing by calling `stop` manually.
|
||||||
|
|
||||||
|
```js
|
||||||
|
fup.on('found', function(dir){
|
||||||
|
// dir === '/f/e/d/c'
|
||||||
|
fup.stop();
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
`error` event is emitted when error happens
|
||||||
|
|
||||||
|
```js
|
||||||
|
fup.on('error', function(e){
|
||||||
|
// if(e) e === new Error('not found')
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
`end` event is emitted at the end of the traversing or after `stop()` is
|
||||||
|
called.
|
||||||
|
|
||||||
|
```js
|
||||||
|
fup.on('end', function(){
|
||||||
|
// happy end
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Sync
|
||||||
|
|
||||||
|
findup(dir, fileName)
|
||||||
|
findup(dir, iteratorSync) with `iteratorSync` return `true` or `false`
|
||||||
|
```js
|
||||||
|
var findup = require('@choojs/findup');
|
||||||
|
|
||||||
|
try{
|
||||||
|
var dir = findup.sync(__dirname + '/f/e/d/c/b/a', 'config.json'); // dir === '/f/e/d/c'
|
||||||
|
}catch(e){
|
||||||
|
// if(e) e === new Error('not found')
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### CLI
|
||||||
|
```js
|
||||||
|
npm install -g @choojs/findup
|
||||||
|
|
||||||
|
$ cd test/fixture/f/e/d/c/b/a/
|
||||||
|
$ findup package.json
|
||||||
|
/root/findup/package.json
|
||||||
|
```
|
||||||
|
|
||||||
|
Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
$ findup -h
|
||||||
|
|
||||||
|
Usage: findup [FILE]
|
||||||
|
|
||||||
|
--name, -n The name of the file to found
|
||||||
|
--dir, -d The directoy where we will start walking up $PWD
|
||||||
|
--help, -h show usage false
|
||||||
|
--verbose, -v print log false
|
||||||
|
```
|
||||||
|
|
||||||
|
### LICENSE MIT
|
||||||
|
|
||||||
|
### Read the tests :)
|
41
node_modules/@choojs/findup/bin/findup.js
generated
vendored
Normal file
41
node_modules/@choojs/findup/bin/findup.js
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
var findup = require('..'),
|
||||||
|
path = require('path'),
|
||||||
|
pkg = require('../package'),
|
||||||
|
program = require('commander'),
|
||||||
|
options = {},
|
||||||
|
optionKeys = ['name', 'dir', 'maxdepth', 'verbose'],
|
||||||
|
EXIT_FAILURE = -1;
|
||||||
|
|
||||||
|
program
|
||||||
|
.version(pkg.version)
|
||||||
|
.option('--name <name>', 'The name of the file to find', String)
|
||||||
|
.option('--dir <dir>', 'The directoy where we will start walking up', process.cwd(), path)
|
||||||
|
.option('--maxdepth <levels>', 'Ascend at most <levels> levels before giving up. -1 means no limit', -1, Number)
|
||||||
|
.option('--verbose', 'print log', false, Boolean)
|
||||||
|
.parse(process.argv);
|
||||||
|
|
||||||
|
optionKeys.forEach(function(optionKey){
|
||||||
|
if (optionKey === 'maxdepth') {
|
||||||
|
options[optionKey] = +program[optionKey];
|
||||||
|
} else {
|
||||||
|
options[optionKey] = program[optionKey];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(program.args && program.args.length >=1 && !options.name){
|
||||||
|
options.name = program.args[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!options.name) {
|
||||||
|
program.outputHelp();
|
||||||
|
process.exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
var file = options.name;
|
||||||
|
|
||||||
|
findup(options.dir, file, options, function(err, dir){
|
||||||
|
if(err) return console.error(err.message ? err.message : err);
|
||||||
|
console.log(path.join(dir, file));
|
||||||
|
});
|
120
node_modules/@choojs/findup/index.js
generated
vendored
Normal file
120
node_modules/@choojs/findup/index.js
generated
vendored
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
var fs = require('fs'),
|
||||||
|
Path = require('path'),
|
||||||
|
util = require('util'),
|
||||||
|
EE = require('events').EventEmitter;
|
||||||
|
|
||||||
|
function fsExists(file, cb) {
|
||||||
|
if (!fs.access) return fs.exists(file, cb);
|
||||||
|
fs.access(file, function(err) {
|
||||||
|
cb(err ? false : true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function fsExistsSync(file) {
|
||||||
|
if (!fs.accessSync) return fs.existsSync(file);
|
||||||
|
try {
|
||||||
|
fs.accessSync(file);
|
||||||
|
} catch(err) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = function(dir, iterator, options, callback){
|
||||||
|
return FindUp(dir, iterator, options, callback);
|
||||||
|
};
|
||||||
|
|
||||||
|
function FindUp(dir, iterator, options, callback){
|
||||||
|
if (!(this instanceof FindUp)) {
|
||||||
|
return new FindUp(dir, iterator, options, callback);
|
||||||
|
}
|
||||||
|
if(typeof options === 'function'){
|
||||||
|
callback = options;
|
||||||
|
options = {};
|
||||||
|
}
|
||||||
|
options = options || {};
|
||||||
|
|
||||||
|
EE.call(this);
|
||||||
|
this.found = false;
|
||||||
|
this.stopPlease = false;
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
if(typeof iterator === 'string'){
|
||||||
|
var file = iterator;
|
||||||
|
iterator = function(dir, cb){
|
||||||
|
return fsExists(Path.join(dir, file), cb);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if(callback) {
|
||||||
|
this.on('found', function(dir){
|
||||||
|
if(options.verbose) console.log(('found '+ dir ));
|
||||||
|
callback(null, dir);
|
||||||
|
self.stop();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.on('end', function(){
|
||||||
|
if(options.verbose) console.log('end');
|
||||||
|
if(!self.found) callback(new Error('not found'));
|
||||||
|
});
|
||||||
|
|
||||||
|
this.on('error', function(err){
|
||||||
|
if(options.verbose) console.log('error', err);
|
||||||
|
callback(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this._find(dir, iterator, options, callback);
|
||||||
|
}
|
||||||
|
util.inherits(FindUp, EE);
|
||||||
|
|
||||||
|
FindUp.prototype._find = function(dir, iterator, options, callback, currentDepth){
|
||||||
|
var self = this;
|
||||||
|
if (typeof currentDepth !== 'number') currentDepth = 0;
|
||||||
|
|
||||||
|
iterator(dir, function(exists){
|
||||||
|
if(options.verbose) console.log(('traverse '+ dir));
|
||||||
|
if (typeof options.maxdepth === 'number' && options.maxdepth >= 0 && currentDepth > options.maxdepth) {
|
||||||
|
return self.emit('end');
|
||||||
|
}
|
||||||
|
currentDepth++;
|
||||||
|
if(exists) {
|
||||||
|
self.found = true;
|
||||||
|
self.emit('found', dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
var parentDir = Path.join(dir, '..');
|
||||||
|
if (self.stopPlease) return self.emit('end');
|
||||||
|
if (dir === parentDir) return self.emit('end');
|
||||||
|
if(dir.indexOf('../../') !== -1 ) return self.emit('error', new Error(dir + ' is not correct.'));
|
||||||
|
self._find(parentDir, iterator, options, callback, currentDepth);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
FindUp.prototype.stop = function(){
|
||||||
|
this.stopPlease = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.FindUp = FindUp;
|
||||||
|
|
||||||
|
module.exports.sync = function(dir, iteratorSync, options){
|
||||||
|
if(typeof iteratorSync === 'string'){
|
||||||
|
var file = iteratorSync;
|
||||||
|
iteratorSync = function(dir){
|
||||||
|
return fsExistsSync(Path.join(dir, file));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
options = options || {};
|
||||||
|
var initialDir = dir;
|
||||||
|
var currentDepth = 0;
|
||||||
|
while(dir !== Path.join(dir, '..')){
|
||||||
|
if (typeof options.maxdepth === 'number' && options.maxdepth >= 0 && currentDepth > options.maxdepth) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
currentDepth++;
|
||||||
|
if(dir.indexOf('../../') !== -1 ) throw new Error(initialDir + ' is not correct.');
|
||||||
|
if(iteratorSync(dir)) return dir;
|
||||||
|
dir = Path.join(dir, '..');
|
||||||
|
}
|
||||||
|
throw new Error('not found');
|
||||||
|
};
|
27
node_modules/@choojs/findup/package.json
generated
vendored
Normal file
27
node_modules/@choojs/findup/package.json
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"name": "@choojs/findup",
|
||||||
|
"description": "Find a file by walking up the directory tree",
|
||||||
|
"version": "0.2.1",
|
||||||
|
"author": "Filirom1 <filirom1@gmail.com>",
|
||||||
|
"bin": {
|
||||||
|
"findup": "bin/findup.js"
|
||||||
|
},
|
||||||
|
"bugs": "https://github.com/choojs/findup/issues",
|
||||||
|
"dependencies": {
|
||||||
|
"commander": "^2.15.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"chai": "^4.1.2",
|
||||||
|
"mocha": "^5.0.5"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/choojs/findup",
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "index.js",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/choojs/findup.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "mocha ./test/*.js"
|
||||||
|
}
|
||||||
|
}
|
164
node_modules/@choojs/findup/test/findup-test.js
generated
vendored
Normal file
164
node_modules/@choojs/findup/test/findup-test.js
generated
vendored
Normal file
|
@ -0,0 +1,164 @@
|
||||||
|
var assert = require('chai').assert,
|
||||||
|
Path = require('path'),
|
||||||
|
fs = require('fs'),
|
||||||
|
findup = require('..');
|
||||||
|
|
||||||
|
describe('find-up', function(){
|
||||||
|
var fixtureDir = Path.join(__dirname, 'fixture', 'f', 'e', 'd', 'c', 'b', 'a'),
|
||||||
|
fsExists = fs.exists ? fs.exists : Path.exists;
|
||||||
|
it('accept a function', function(done){
|
||||||
|
findup(fixtureDir, function(dir, cb){
|
||||||
|
return fsExists(Path.join(dir, 'config.json'), cb);
|
||||||
|
}, function(err, file){
|
||||||
|
assert.ifError(err);
|
||||||
|
assert.equal(file, Path.join(__dirname, 'fixture', 'f', 'e', 'd', 'c'));
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('accept a string', function(done){
|
||||||
|
findup(fixtureDir, 'config.json', function(err, file){
|
||||||
|
assert.ifError(err);
|
||||||
|
assert.equal(file, Path.join(__dirname, 'fixture', 'f', 'e', 'd', 'c'));
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('is usable with the Object syntax', function(done) {
|
||||||
|
new findup.FindUp(fixtureDir, 'config.json', function(err, file){
|
||||||
|
assert.ifError(err);
|
||||||
|
assert.equal(file, Path.join(__dirname, 'fixture', 'f', 'e', 'd', 'c'));
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('find several files when using with the EventEmitter syntax', function(done){
|
||||||
|
var ee = new findup.FindUp(fixtureDir, 'config.json');
|
||||||
|
ee.once('found', function(file){
|
||||||
|
assert.equal(file, Path.join(__dirname, 'fixture', 'f', 'e', 'd', 'c'));
|
||||||
|
|
||||||
|
ee.once('found', function(file){
|
||||||
|
assert.equal(file, Path.join(__dirname, 'fixture'));
|
||||||
|
|
||||||
|
ee.once('end', function(){
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('return files in top dir', function(done){
|
||||||
|
findup(fixtureDir, 'top.json', function(err, file){
|
||||||
|
assert.ifError(err);
|
||||||
|
assert.equal(file, Path.join(__dirname, 'fixture', 'f', 'e', 'd', 'c', 'b', 'a'));
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('return files in root dir', function(done){
|
||||||
|
findup(fixtureDir, 'dev', function(err, file){
|
||||||
|
assert.ifError(err);
|
||||||
|
assert.equal(file, '/');
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('return an error when looking for non existiong files', function(done){
|
||||||
|
findup(fixtureDir, 'toto.json', function(err, file){
|
||||||
|
assert.isNotNull(err);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('return an error when looking in a non existing directory', function(done){
|
||||||
|
findup('dsqkjfnqsdkjghq', 'toto.json', function(err, file){
|
||||||
|
assert.isNotNull(err);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('trigger an error event when looking in a non existing directory', function(done){
|
||||||
|
findup('dsqkjfnqsdkjghq', 'toto.json').on('error', function(err, files){
|
||||||
|
assert.isNotNull(err);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Sync API', function(){
|
||||||
|
it('accept a string', function(){
|
||||||
|
var file = findup.sync(fixtureDir, 'config.json');
|
||||||
|
assert.equal(file, Path.join(__dirname, 'fixture', 'f', 'e', 'd', 'c'));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('return a file in top dir', function(){
|
||||||
|
var file = findup.sync(fixtureDir, 'top.json');
|
||||||
|
assert.equal(file, Path.join(__dirname, 'fixture', 'f', 'e', 'd', 'c', 'b', 'a'));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('throw error when looking for a non existing file', function(){
|
||||||
|
assert.throw(function(){
|
||||||
|
findup.sync(fixtureDir, 'toto.json');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('throw error when looking for in a non existing directory', function(){
|
||||||
|
assert.throw(function(){
|
||||||
|
findup.sync('uhjhbjkg,nfg', 'toto.json');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should work with maxdepth (top, maxdepth 0)', function(){
|
||||||
|
var file = findup.sync(fixtureDir, 'top.json', {maxdepth: 0});
|
||||||
|
assert.equal(file, Path.join(__dirname, 'fixture', 'f', 'e', 'd', 'c', 'b', 'a'));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should work with maxdepth (config, maxdepth 0)', function(){
|
||||||
|
try {
|
||||||
|
findup.sync(fixtureDir, 'config.json', {maxdepth: 0});
|
||||||
|
} catch (err) {
|
||||||
|
assert.equal(err.message, 'not found');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should work with maxdepth (config, maxdepth 2)', function(){
|
||||||
|
var file = findup.sync(fixtureDir, 'config.json', {maxdepth: 2});
|
||||||
|
assert.equal(file, Path.join(__dirname, 'fixture', 'f', 'e', 'd', 'c'));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should work with maxdepth (config, maxdepth -1)', function(){
|
||||||
|
var file = findup.sync(fixtureDir, 'config.json', {maxdepth: -1});
|
||||||
|
assert.equal(file, Path.join(__dirname, 'fixture', 'f', 'e', 'd', 'c'));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should work with maxdepth (top, maxdepth 0)', function(done){
|
||||||
|
findup(fixtureDir, 'top.json', {maxdepth: 0}, function(err, file){
|
||||||
|
assert.ifError(err);
|
||||||
|
assert.equal(file, Path.join(__dirname, 'fixture', 'f', 'e', 'd', 'c', 'b', 'a'));
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should work with maxdepth (config, maxdepth 0)', function(done){
|
||||||
|
findup(fixtureDir, 'config.json', {maxdepth: 0}, function(err, file){
|
||||||
|
assert.equal(err.message, 'not found');
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should work with maxdepth (config, maxdepth 2)', function(done){
|
||||||
|
findup(fixtureDir, 'config.json', {maxdepth: 2}, function(err, file){
|
||||||
|
assert.ifError(err);
|
||||||
|
assert.equal(file, Path.join(__dirname, 'fixture', 'f', 'e', 'd', 'c'));
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should work with maxdepth (config, maxdepth -1)', function(done){
|
||||||
|
findup(fixtureDir, 'config.json', {maxdepth: -1}, function(err, file){
|
||||||
|
assert.ifError(err);
|
||||||
|
assert.equal(file, Path.join(__dirname, 'fixture', 'f', 'e', 'd', 'c'));
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
0
node_modules/@choojs/findup/test/fixture/config.json
generated
vendored
Normal file
0
node_modules/@choojs/findup/test/fixture/config.json
generated
vendored
Normal file
0
node_modules/@choojs/findup/test/fixture/f/e/d/c/b/a/top.json
generated
vendored
Normal file
0
node_modules/@choojs/findup/test/fixture/f/e/d/c/b/a/top.json
generated
vendored
Normal file
0
node_modules/@choojs/findup/test/fixture/f/e/d/c/config.json
generated
vendored
Normal file
0
node_modules/@choojs/findup/test/fixture/f/e/d/c/config.json
generated
vendored
Normal file
1
node_modules/@choojs/findup/test/mocha.opts
generated
vendored
Normal file
1
node_modules/@choojs/findup/test/mocha.opts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
--reporter spec
|
21
node_modules/@octokit/auth-token/LICENSE
generated
vendored
Normal file
21
node_modules/@octokit/auth-token/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2019 Octokit contributors
|
||||||
|
|
||||||
|
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.
|
290
node_modules/@octokit/auth-token/README.md
generated
vendored
Normal file
290
node_modules/@octokit/auth-token/README.md
generated
vendored
Normal file
|
@ -0,0 +1,290 @@
|
||||||
|
# auth-token.js
|
||||||
|
|
||||||
|
> GitHub API token authentication for browsers and Node.js
|
||||||
|
|
||||||
|
[![@latest](https://img.shields.io/npm/v/@octokit/auth-token.svg)](https://www.npmjs.com/package/@octokit/auth-token)
|
||||||
|
[![Build Status](https://github.com/octokit/auth-token.js/workflows/Test/badge.svg)](https://github.com/octokit/auth-token.js/actions?query=workflow%3ATest)
|
||||||
|
|
||||||
|
`@octokit/auth-token` is the simplest of [GitHub’s authentication strategies](https://github.com/octokit/auth.js).
|
||||||
|
|
||||||
|
It is useful if you want to support multiple authentication strategies, as it’s API is compatible with its sibling packages for [basic](https://github.com/octokit/auth-basic.js), [GitHub App](https://github.com/octokit/auth-app.js) and [OAuth app](https://github.com/octokit/auth.js) authentication.
|
||||||
|
|
||||||
|
<!-- toc -->
|
||||||
|
|
||||||
|
- [Usage](#usage)
|
||||||
|
- [`createTokenAuth(token) options`](#createtokenauthtoken-options)
|
||||||
|
- [`auth()`](#auth)
|
||||||
|
- [Authentication object](#authentication-object)
|
||||||
|
- [`auth.hook(request, route, options)` or `auth.hook(request, options)`](#authhookrequest-route-options-or-authhookrequest-options)
|
||||||
|
- [Find more information](#find-more-information)
|
||||||
|
- [Find out what scopes are enabled for oauth tokens](#find-out-what-scopes-are-enabled-for-oauth-tokens)
|
||||||
|
- [Find out if token is a personal access token or if it belongs to an OAuth app](#find-out-if-token-is-a-personal-access-token-or-if-it-belongs-to-an-oauth-app)
|
||||||
|
- [Find out what permissions are enabled for a repository](#find-out-what-permissions-are-enabled-for-a-repository)
|
||||||
|
- [Use token for git operations](#use-token-for-git-operations)
|
||||||
|
- [License](#license)
|
||||||
|
|
||||||
|
<!-- tocstop -->
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tbody valign=top align=left>
|
||||||
|
<tr><th>
|
||||||
|
Browsers
|
||||||
|
</th><td width=100%>
|
||||||
|
|
||||||
|
Load `@octokit/auth-token` directly from [cdn.skypack.dev](https://cdn.skypack.dev)
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script type="module">
|
||||||
|
import { createTokenAuth } from "https://cdn.skypack.dev/@octokit/auth-token";
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
</td></tr>
|
||||||
|
<tr><th>
|
||||||
|
Node
|
||||||
|
</th><td>
|
||||||
|
|
||||||
|
Install with <code>npm install @octokit/auth-token</code>
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { createTokenAuth } = require("@octokit/auth-token");
|
||||||
|
// or: import { createTokenAuth } from "@octokit/auth-token";
|
||||||
|
```
|
||||||
|
|
||||||
|
</td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
```js
|
||||||
|
const auth = createTokenAuth("ghp_PersonalAccessToken01245678900000000");
|
||||||
|
const authentication = await auth();
|
||||||
|
// {
|
||||||
|
// type: 'token',
|
||||||
|
// token: 'ghp_PersonalAccessToken01245678900000000',
|
||||||
|
// tokenType: 'oauth'
|
||||||
|
// }
|
||||||
|
```
|
||||||
|
|
||||||
|
## `createTokenAuth(token) options`
|
||||||
|
|
||||||
|
The `createTokenAuth` method accepts a single argument of type string, which is the token. The passed token can be one of the following:
|
||||||
|
|
||||||
|
- [Personal access token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line)
|
||||||
|
- [OAuth access token](https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/)
|
||||||
|
- [GITHUB_TOKEN provided to GitHub Actions](https://developer.github.com/actions/creating-github-actions/accessing-the-runtime-environment/#environment-variables)
|
||||||
|
- Installation access token ([server-to-server](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation))
|
||||||
|
- User authentication for installation ([user-to-server](https://docs.github.com/en/developers/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps))
|
||||||
|
|
||||||
|
Examples
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Personal access token or OAuth access token
|
||||||
|
createTokenAuth("ghp_PersonalAccessToken01245678900000000");
|
||||||
|
// {
|
||||||
|
// type: 'token',
|
||||||
|
// token: 'ghp_PersonalAccessToken01245678900000000',
|
||||||
|
// tokenType: 'oauth'
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Installation access token or GitHub Action token
|
||||||
|
createTokenAuth("ghs_InstallallationOrActionToken00000000");
|
||||||
|
// {
|
||||||
|
// type: 'token',
|
||||||
|
// token: 'ghs_InstallallationOrActionToken00000000',
|
||||||
|
// tokenType: 'installation'
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Installation access token or GitHub Action token
|
||||||
|
createTokenAuth("ghu_InstallationUserToServer000000000000");
|
||||||
|
// {
|
||||||
|
// type: 'token',
|
||||||
|
// token: 'ghu_InstallationUserToServer000000000000',
|
||||||
|
// tokenType: 'user-to-server'
|
||||||
|
// }
|
||||||
|
```
|
||||||
|
|
||||||
|
## `auth()`
|
||||||
|
|
||||||
|
The `auth()` method has no options. It returns a promise which resolves with the the authentication object.
|
||||||
|
|
||||||
|
## Authentication object
|
||||||
|
|
||||||
|
<table width="100%">
|
||||||
|
<thead align=left>
|
||||||
|
<tr>
|
||||||
|
<th width=150>
|
||||||
|
name
|
||||||
|
</th>
|
||||||
|
<th width=70>
|
||||||
|
type
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
description
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody align=left valign=top>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<code>type</code>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<code>string</code>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<code>"token"</code>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<code>token</code>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<code>string</code>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
The provided token.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<code>tokenType</code>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<code>string</code>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
Can be either <code>"oauth"</code> for personal access tokens and OAuth tokens, <code>"installation"</code> for installation access tokens (includes <code>GITHUB_TOKEN</code> provided to GitHub Actions), <code>"app"</code> for a GitHub App JSON Web Token, or <code>"user-to-server"</code> for a user authentication token through an app installation.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
## `auth.hook(request, route, options)` or `auth.hook(request, options)`
|
||||||
|
|
||||||
|
`auth.hook()` hooks directly into the request life cycle. It authenticates the request using the provided token.
|
||||||
|
|
||||||
|
The `request` option is an instance of [`@octokit/request`](https://github.com/octokit/request.js#readme). The `route`/`options` parameters are the same as for the [`request()` method](https://github.com/octokit/request.js#request).
|
||||||
|
|
||||||
|
`auth.hook()` can be called directly to send an authenticated request
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { data: authorizations } = await auth.hook(
|
||||||
|
request,
|
||||||
|
"GET /authorizations"
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
Or it can be passed as option to [`request()`](https://github.com/octokit/request.js#request).
|
||||||
|
|
||||||
|
```js
|
||||||
|
const requestWithAuth = request.defaults({
|
||||||
|
request: {
|
||||||
|
hook: auth.hook,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const { data: authorizations } = await requestWithAuth("GET /authorizations");
|
||||||
|
```
|
||||||
|
|
||||||
|
## Find more information
|
||||||
|
|
||||||
|
`auth()` does not send any requests, it only transforms the provided token string into an authentication object.
|
||||||
|
|
||||||
|
Here is a list of things you can do to retrieve further information
|
||||||
|
|
||||||
|
### Find out what scopes are enabled for oauth tokens
|
||||||
|
|
||||||
|
Note that this does not work for installations. There is no way to retrieve permissions based on an installation access tokens.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const TOKEN = "ghp_PersonalAccessToken01245678900000000";
|
||||||
|
|
||||||
|
const auth = createTokenAuth(TOKEN);
|
||||||
|
const authentication = await auth();
|
||||||
|
|
||||||
|
const response = await request("HEAD /", {
|
||||||
|
headers: authentication.headers,
|
||||||
|
});
|
||||||
|
const scopes = response.headers["x-oauth-scopes"].split(/,\s+/);
|
||||||
|
|
||||||
|
if (scopes.length) {
|
||||||
|
console.log(
|
||||||
|
`"${TOKEN}" has ${scopes.length} scopes enabled: ${scopes.join(", ")}`
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
console.log(`"${TOKEN}" has no scopes enabled`);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Find out if token is a personal access token or if it belongs to an OAuth app
|
||||||
|
|
||||||
|
```js
|
||||||
|
const TOKEN = "ghp_PersonalAccessToken01245678900000000";
|
||||||
|
|
||||||
|
const auth = createTokenAuth(TOKEN);
|
||||||
|
const authentication = await auth();
|
||||||
|
|
||||||
|
const response = await request("HEAD /", {
|
||||||
|
headers: authentication.headers,
|
||||||
|
});
|
||||||
|
const clientId = response.headers["x-oauth-client-id"];
|
||||||
|
|
||||||
|
if (clientId) {
|
||||||
|
console.log(
|
||||||
|
`"${token}" is an OAuth token, its app’s client_id is ${clientId}.`
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
console.log(`"${token}" is a personal access token`);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Find out what permissions are enabled for a repository
|
||||||
|
|
||||||
|
Note that the `permissions` key is not set when authenticated using an installation access token.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const TOKEN = "ghp_PersonalAccessToken01245678900000000";
|
||||||
|
|
||||||
|
const auth = createTokenAuth(TOKEN);
|
||||||
|
const authentication = await auth();
|
||||||
|
|
||||||
|
const response = await request("GET /repos/{owner}/{repo}", {
|
||||||
|
owner: 'octocat',
|
||||||
|
repo: 'hello-world'
|
||||||
|
headers: authentication.headers
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(response.data.permissions)
|
||||||
|
// {
|
||||||
|
// admin: true,
|
||||||
|
// push: true,
|
||||||
|
// pull: true
|
||||||
|
// }
|
||||||
|
```
|
||||||
|
|
||||||
|
### Use token for git operations
|
||||||
|
|
||||||
|
Both OAuth and installation access tokens can be used for git operations. However, when using with an installation, [the token must be prefixed with `x-access-token`](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#http-based-git-access-by-an-installation).
|
||||||
|
|
||||||
|
This example is using the [`execa`](https://github.com/sindresorhus/execa) package to run a `git push` command.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const TOKEN = "ghp_PersonalAccessToken01245678900000000";
|
||||||
|
|
||||||
|
const auth = createTokenAuth(TOKEN);
|
||||||
|
const { token, tokenType } = await auth();
|
||||||
|
const tokenWithPrefix =
|
||||||
|
tokenType === "installation" ? `x-access-token:${token}` : token;
|
||||||
|
|
||||||
|
const repositoryUrl = `https://${tokenWithPrefix}@github.com/octocat/hello-world.git`;
|
||||||
|
|
||||||
|
const { stdout } = await execa("git", ["push", repositoryUrl]);
|
||||||
|
console.log(stdout);
|
||||||
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
[MIT](LICENSE)
|
55
node_modules/@octokit/auth-token/dist-node/index.js
generated
vendored
Normal file
55
node_modules/@octokit/auth-token/dist-node/index.js
generated
vendored
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
|
||||||
|
const REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
|
||||||
|
const REGEX_IS_INSTALLATION = /^ghs_/;
|
||||||
|
const REGEX_IS_USER_TO_SERVER = /^ghu_/;
|
||||||
|
async function auth(token) {
|
||||||
|
const isApp = token.split(/\./).length === 3;
|
||||||
|
const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
|
||||||
|
const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
|
||||||
|
const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
|
||||||
|
return {
|
||||||
|
type: "token",
|
||||||
|
token: token,
|
||||||
|
tokenType
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prefix token for usage in the Authorization header
|
||||||
|
*
|
||||||
|
* @param token OAuth token or JSON Web Token
|
||||||
|
*/
|
||||||
|
function withAuthorizationPrefix(token) {
|
||||||
|
if (token.split(/\./).length === 3) {
|
||||||
|
return `bearer ${token}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return `token ${token}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function hook(token, request, route, parameters) {
|
||||||
|
const endpoint = request.endpoint.merge(route, parameters);
|
||||||
|
endpoint.headers.authorization = withAuthorizationPrefix(token);
|
||||||
|
return request(endpoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
const createTokenAuth = function createTokenAuth(token) {
|
||||||
|
if (!token) {
|
||||||
|
throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof token !== "string") {
|
||||||
|
throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
|
||||||
|
}
|
||||||
|
|
||||||
|
token = token.replace(/^(token|bearer) +/i, "");
|
||||||
|
return Object.assign(auth.bind(null, token), {
|
||||||
|
hook: hook.bind(null, token)
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.createTokenAuth = createTokenAuth;
|
||||||
|
//# sourceMappingURL=index.js.map
|
1
node_modules/@octokit/auth-token/dist-node/index.js.map
generated
vendored
Normal file
1
node_modules/@octokit/auth-token/dist-node/index.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.js","sources":["../dist-src/auth.js","../dist-src/with-authorization-prefix.js","../dist-src/hook.js","../dist-src/index.js"],"sourcesContent":["const REGEX_IS_INSTALLATION_LEGACY = /^v1\\./;\nconst REGEX_IS_INSTALLATION = /^ghs_/;\nconst REGEX_IS_USER_TO_SERVER = /^ghu_/;\nexport async function auth(token) {\n const isApp = token.split(/\\./).length === 3;\n const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) ||\n REGEX_IS_INSTALLATION.test(token);\n const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);\n const tokenType = isApp\n ? \"app\"\n : isInstallation\n ? \"installation\"\n : isUserToServer\n ? \"user-to-server\"\n : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType,\n };\n}\n","/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nexport function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n return `token ${token}`;\n}\n","import { withAuthorizationPrefix } from \"./with-authorization-prefix\";\nexport async function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n","import { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nexport const createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token),\n });\n};\n"],"names":["REGEX_IS_INSTALLATION_LEGACY","REGEX_IS_INSTALLATION","REGEX_IS_USER_TO_SERVER","auth","token","isApp","split","length","isInstallation","test","isUserToServer","tokenType","type","withAuthorizationPrefix","hook","request","route","parameters","endpoint","merge","headers","authorization","createTokenAuth","Error","replace","Object","assign","bind"],"mappings":";;;;AAAA,MAAMA,4BAA4B,GAAG,OAArC;AACA,MAAMC,qBAAqB,GAAG,OAA9B;AACA,MAAMC,uBAAuB,GAAG,OAAhC;AACO,eAAeC,IAAf,CAAoBC,KAApB,EAA2B;AAC9B,QAAMC,KAAK,GAAGD,KAAK,CAACE,KAAN,CAAY,IAAZ,EAAkBC,MAAlB,KAA6B,CAA3C;AACA,QAAMC,cAAc,GAAGR,4BAA4B,CAACS,IAA7B,CAAkCL,KAAlC,KACnBH,qBAAqB,CAACQ,IAAtB,CAA2BL,KAA3B,CADJ;AAEA,QAAMM,cAAc,GAAGR,uBAAuB,CAACO,IAAxB,CAA6BL,KAA7B,CAAvB;AACA,QAAMO,SAAS,GAAGN,KAAK,GACjB,KADiB,GAEjBG,cAAc,GACV,cADU,GAEVE,cAAc,GACV,gBADU,GAEV,OANd;AAOA,SAAO;AACHE,IAAAA,IAAI,EAAE,OADH;AAEHR,IAAAA,KAAK,EAAEA,KAFJ;AAGHO,IAAAA;AAHG,GAAP;AAKH;;ACpBD;AACA;AACA;AACA;AACA;AACA,AAAO,SAASE,uBAAT,CAAiCT,KAAjC,EAAwC;AAC3C,MAAIA,KAAK,CAACE,KAAN,CAAY,IAAZ,EAAkBC,MAAlB,KAA6B,CAAjC,EAAoC;AAChC,WAAQ,UAASH,KAAM,EAAvB;AACH;;AACD,SAAQ,SAAQA,KAAM,EAAtB;AACH;;ACTM,eAAeU,IAAf,CAAoBV,KAApB,EAA2BW,OAA3B,EAAoCC,KAApC,EAA2CC,UAA3C,EAAuD;AAC1D,QAAMC,QAAQ,GAAGH,OAAO,CAACG,QAAR,CAAiBC,KAAjB,CAAuBH,KAAvB,EAA8BC,UAA9B,CAAjB;AACAC,EAAAA,QAAQ,CAACE,OAAT,CAAiBC,aAAjB,GAAiCR,uBAAuB,CAACT,KAAD,CAAxD;AACA,SAAOW,OAAO,CAACG,QAAD,CAAd;AACH;;MCHYI,eAAe,GAAG,SAASA,eAAT,CAAyBlB,KAAzB,EAAgC;AAC3D,MAAI,CAACA,KAAL,EAAY;AACR,UAAM,IAAImB,KAAJ,CAAU,0DAAV,CAAN;AACH;;AACD,MAAI,OAAOnB,KAAP,KAAiB,QAArB,EAA+B;AAC3B,UAAM,IAAImB,KAAJ,CAAU,uEAAV,CAAN;AACH;;AACDnB,EAAAA,KAAK,GAAGA,KAAK,CAACoB,OAAN,CAAc,oBAAd,EAAoC,EAApC,CAAR;AACA,SAAOC,MAAM,CAACC,MAAP,CAAcvB,IAAI,CAACwB,IAAL,CAAU,IAAV,EAAgBvB,KAAhB,CAAd,EAAsC;AACzCU,IAAAA,IAAI,EAAEA,IAAI,CAACa,IAAL,CAAU,IAAV,EAAgBvB,KAAhB;AADmC,GAAtC,CAAP;AAGH,CAXM;;;;"}
|
21
node_modules/@octokit/auth-token/dist-src/auth.js
generated
vendored
Normal file
21
node_modules/@octokit/auth-token/dist-src/auth.js
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
const REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
|
||||||
|
const REGEX_IS_INSTALLATION = /^ghs_/;
|
||||||
|
const REGEX_IS_USER_TO_SERVER = /^ghu_/;
|
||||||
|
export async function auth(token) {
|
||||||
|
const isApp = token.split(/\./).length === 3;
|
||||||
|
const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) ||
|
||||||
|
REGEX_IS_INSTALLATION.test(token);
|
||||||
|
const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
|
||||||
|
const tokenType = isApp
|
||||||
|
? "app"
|
||||||
|
: isInstallation
|
||||||
|
? "installation"
|
||||||
|
: isUserToServer
|
||||||
|
? "user-to-server"
|
||||||
|
: "oauth";
|
||||||
|
return {
|
||||||
|
type: "token",
|
||||||
|
token: token,
|
||||||
|
tokenType,
|
||||||
|
};
|
||||||
|
}
|
6
node_modules/@octokit/auth-token/dist-src/hook.js
generated
vendored
Normal file
6
node_modules/@octokit/auth-token/dist-src/hook.js
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { withAuthorizationPrefix } from "./with-authorization-prefix";
|
||||||
|
export async function hook(token, request, route, parameters) {
|
||||||
|
const endpoint = request.endpoint.merge(route, parameters);
|
||||||
|
endpoint.headers.authorization = withAuthorizationPrefix(token);
|
||||||
|
return request(endpoint);
|
||||||
|
}
|
14
node_modules/@octokit/auth-token/dist-src/index.js
generated
vendored
Normal file
14
node_modules/@octokit/auth-token/dist-src/index.js
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import { auth } from "./auth";
|
||||||
|
import { hook } from "./hook";
|
||||||
|
export const createTokenAuth = function createTokenAuth(token) {
|
||||||
|
if (!token) {
|
||||||
|
throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
|
||||||
|
}
|
||||||
|
if (typeof token !== "string") {
|
||||||
|
throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
|
||||||
|
}
|
||||||
|
token = token.replace(/^(token|bearer) +/i, "");
|
||||||
|
return Object.assign(auth.bind(null, token), {
|
||||||
|
hook: hook.bind(null, token),
|
||||||
|
});
|
||||||
|
};
|
1
node_modules/@octokit/auth-token/dist-src/types.js
generated
vendored
Normal file
1
node_modules/@octokit/auth-token/dist-src/types.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
11
node_modules/@octokit/auth-token/dist-src/with-authorization-prefix.js
generated
vendored
Normal file
11
node_modules/@octokit/auth-token/dist-src/with-authorization-prefix.js
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Prefix token for usage in the Authorization header
|
||||||
|
*
|
||||||
|
* @param token OAuth token or JSON Web Token
|
||||||
|
*/
|
||||||
|
export function withAuthorizationPrefix(token) {
|
||||||
|
if (token.split(/\./).length === 3) {
|
||||||
|
return `bearer ${token}`;
|
||||||
|
}
|
||||||
|
return `token ${token}`;
|
||||||
|
}
|
2
node_modules/@octokit/auth-token/dist-types/auth.d.ts
generated
vendored
Normal file
2
node_modules/@octokit/auth-token/dist-types/auth.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import { Token, Authentication } from "./types";
|
||||||
|
export declare function auth(token: Token): Promise<Authentication>;
|
2
node_modules/@octokit/auth-token/dist-types/hook.d.ts
generated
vendored
Normal file
2
node_modules/@octokit/auth-token/dist-types/hook.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import { AnyResponse, EndpointOptions, RequestInterface, RequestParameters, Route, Token } from "./types";
|
||||||
|
export declare function hook(token: Token, request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise<AnyResponse>;
|
7
node_modules/@octokit/auth-token/dist-types/index.d.ts
generated
vendored
Normal file
7
node_modules/@octokit/auth-token/dist-types/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
import { StrategyInterface, Token, Authentication } from "./types";
|
||||||
|
export declare type Types = {
|
||||||
|
StrategyOptions: Token;
|
||||||
|
AuthOptions: never;
|
||||||
|
Authentication: Authentication;
|
||||||
|
};
|
||||||
|
export declare const createTokenAuth: StrategyInterface;
|
33
node_modules/@octokit/auth-token/dist-types/types.d.ts
generated
vendored
Normal file
33
node_modules/@octokit/auth-token/dist-types/types.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
import * as OctokitTypes from "@octokit/types";
|
||||||
|
export declare type AnyResponse = OctokitTypes.OctokitResponse<any>;
|
||||||
|
export declare type StrategyInterface = OctokitTypes.StrategyInterface<[
|
||||||
|
Token
|
||||||
|
], [
|
||||||
|
], Authentication>;
|
||||||
|
export declare type EndpointDefaults = OctokitTypes.EndpointDefaults;
|
||||||
|
export declare type EndpointOptions = OctokitTypes.EndpointOptions;
|
||||||
|
export declare type RequestParameters = OctokitTypes.RequestParameters;
|
||||||
|
export declare type RequestInterface = OctokitTypes.RequestInterface;
|
||||||
|
export declare type Route = OctokitTypes.Route;
|
||||||
|
export declare type Token = string;
|
||||||
|
export declare type OAuthTokenAuthentication = {
|
||||||
|
type: "token";
|
||||||
|
tokenType: "oauth";
|
||||||
|
token: Token;
|
||||||
|
};
|
||||||
|
export declare type InstallationTokenAuthentication = {
|
||||||
|
type: "token";
|
||||||
|
tokenType: "installation";
|
||||||
|
token: Token;
|
||||||
|
};
|
||||||
|
export declare type AppAuthentication = {
|
||||||
|
type: "token";
|
||||||
|
tokenType: "app";
|
||||||
|
token: Token;
|
||||||
|
};
|
||||||
|
export declare type UserToServerAuthentication = {
|
||||||
|
type: "token";
|
||||||
|
tokenType: "user-to-server";
|
||||||
|
token: Token;
|
||||||
|
};
|
||||||
|
export declare type Authentication = OAuthTokenAuthentication | InstallationTokenAuthentication | AppAuthentication | UserToServerAuthentication;
|
6
node_modules/@octokit/auth-token/dist-types/with-authorization-prefix.d.ts
generated
vendored
Normal file
6
node_modules/@octokit/auth-token/dist-types/with-authorization-prefix.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
/**
|
||||||
|
* Prefix token for usage in the Authorization header
|
||||||
|
*
|
||||||
|
* @param token OAuth token or JSON Web Token
|
||||||
|
*/
|
||||||
|
export declare function withAuthorizationPrefix(token: string): string;
|
55
node_modules/@octokit/auth-token/dist-web/index.js
generated
vendored
Normal file
55
node_modules/@octokit/auth-token/dist-web/index.js
generated
vendored
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
const REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
|
||||||
|
const REGEX_IS_INSTALLATION = /^ghs_/;
|
||||||
|
const REGEX_IS_USER_TO_SERVER = /^ghu_/;
|
||||||
|
async function auth(token) {
|
||||||
|
const isApp = token.split(/\./).length === 3;
|
||||||
|
const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) ||
|
||||||
|
REGEX_IS_INSTALLATION.test(token);
|
||||||
|
const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
|
||||||
|
const tokenType = isApp
|
||||||
|
? "app"
|
||||||
|
: isInstallation
|
||||||
|
? "installation"
|
||||||
|
: isUserToServer
|
||||||
|
? "user-to-server"
|
||||||
|
: "oauth";
|
||||||
|
return {
|
||||||
|
type: "token",
|
||||||
|
token: token,
|
||||||
|
tokenType,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prefix token for usage in the Authorization header
|
||||||
|
*
|
||||||
|
* @param token OAuth token or JSON Web Token
|
||||||
|
*/
|
||||||
|
function withAuthorizationPrefix(token) {
|
||||||
|
if (token.split(/\./).length === 3) {
|
||||||
|
return `bearer ${token}`;
|
||||||
|
}
|
||||||
|
return `token ${token}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function hook(token, request, route, parameters) {
|
||||||
|
const endpoint = request.endpoint.merge(route, parameters);
|
||||||
|
endpoint.headers.authorization = withAuthorizationPrefix(token);
|
||||||
|
return request(endpoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
const createTokenAuth = function createTokenAuth(token) {
|
||||||
|
if (!token) {
|
||||||
|
throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
|
||||||
|
}
|
||||||
|
if (typeof token !== "string") {
|
||||||
|
throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
|
||||||
|
}
|
||||||
|
token = token.replace(/^(token|bearer) +/i, "");
|
||||||
|
return Object.assign(auth.bind(null, token), {
|
||||||
|
hook: hook.bind(null, token),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export { createTokenAuth };
|
||||||
|
//# sourceMappingURL=index.js.map
|
1
node_modules/@octokit/auth-token/dist-web/index.js.map
generated
vendored
Normal file
1
node_modules/@octokit/auth-token/dist-web/index.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.js","sources":["../dist-src/auth.js","../dist-src/with-authorization-prefix.js","../dist-src/hook.js","../dist-src/index.js"],"sourcesContent":["const REGEX_IS_INSTALLATION_LEGACY = /^v1\\./;\nconst REGEX_IS_INSTALLATION = /^ghs_/;\nconst REGEX_IS_USER_TO_SERVER = /^ghu_/;\nexport async function auth(token) {\n const isApp = token.split(/\\./).length === 3;\n const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) ||\n REGEX_IS_INSTALLATION.test(token);\n const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);\n const tokenType = isApp\n ? \"app\"\n : isInstallation\n ? \"installation\"\n : isUserToServer\n ? \"user-to-server\"\n : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType,\n };\n}\n","/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nexport function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n return `token ${token}`;\n}\n","import { withAuthorizationPrefix } from \"./with-authorization-prefix\";\nexport async function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n","import { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nexport const createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token),\n });\n};\n"],"names":[],"mappings":"AAAA,MAAM,4BAA4B,GAAG,OAAO,CAAC;AAC7C,MAAM,qBAAqB,GAAG,OAAO,CAAC;AACtC,MAAM,uBAAuB,GAAG,OAAO,CAAC;AACjC,eAAe,IAAI,CAAC,KAAK,EAAE;AAClC,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AACjD,IAAI,MAAM,cAAc,GAAG,4BAA4B,CAAC,IAAI,CAAC,KAAK,CAAC;AACnE,QAAQ,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1C,IAAI,MAAM,cAAc,GAAG,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/D,IAAI,MAAM,SAAS,GAAG,KAAK;AAC3B,UAAU,KAAK;AACf,UAAU,cAAc;AACxB,cAAc,cAAc;AAC5B,cAAc,cAAc;AAC5B,kBAAkB,gBAAgB;AAClC,kBAAkB,OAAO,CAAC;AAC1B,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,OAAO;AACrB,QAAQ,KAAK,EAAE,KAAK;AACpB,QAAQ,SAAS;AACjB,KAAK,CAAC;AACN;;ACpBA;AACA;AACA;AACA;AACA;AACA,AAAO,SAAS,uBAAuB,CAAC,KAAK,EAAE;AAC/C,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;AACxC,QAAQ,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AACjC,KAAK;AACL,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAC5B,CAAC;;ACTM,eAAe,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE;AAC9D,IAAI,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AAC/D,IAAI,QAAQ,CAAC,OAAO,CAAC,aAAa,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;AACpE,IAAI,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC7B,CAAC;;ACHW,MAAC,eAAe,GAAG,SAAS,eAAe,CAAC,KAAK,EAAE;AAC/D,IAAI,IAAI,CAAC,KAAK,EAAE;AAChB,QAAQ,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;AACpF,KAAK;AACL,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;AACjG,KAAK;AACL,IAAI,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;AACpD,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;AACjD,QAAQ,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC;AACpC,KAAK,CAAC,CAAC;AACP,CAAC;;;;"}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue