mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
chore: lint
This commit is contained in:
parent
154b4bd627
commit
610ba8827f
5 changed files with 42 additions and 24 deletions
6
.github/workflows/docker.yml
vendored
6
.github/workflows/docker.yml
vendored
|
|
@ -27,11 +27,9 @@ jobs:
|
|||
run: redrun lint
|
||||
- name: Build
|
||||
id: build
|
||||
run: >
|
||||
run: |
|
||||
redrun build
|
||||
|
||||
echo "::set-output name=version::$(grep '"version":' package.json -m1
|
||||
| cut -d\" -f4)"
|
||||
echo "::set-output name=version::$(grep '"version":' package.json -m1 | cut -d\" -f4)"
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
|
|
|
|||
|
|
@ -74,13 +74,14 @@ function CloudCmdProto(DOM) {
|
|||
right: 'asc',
|
||||
};
|
||||
|
||||
this.changeDir = async (path, {
|
||||
isRefresh,
|
||||
panel,
|
||||
history = true,
|
||||
noCurrent,
|
||||
currentName,
|
||||
} = {}) => {
|
||||
this.changeDir = async (path, overrides = {}) => {
|
||||
const {
|
||||
isRefresh,
|
||||
panel,
|
||||
history = true,
|
||||
noCurrent,
|
||||
currentName,
|
||||
} = overrides;
|
||||
const refresh = isRefresh;
|
||||
let panelChanged;
|
||||
|
||||
|
|
|
|||
|
|
@ -285,15 +285,17 @@ test('current-file: parseHrefAttribute', (t) => {
|
|||
t.end();
|
||||
});
|
||||
|
||||
function getDOM({
|
||||
link = {},
|
||||
getCurrentDirPath = stub(),
|
||||
getCurrentDirName = stub(),
|
||||
getByDataName = stub(),
|
||||
isContainClass = stub(),
|
||||
getCurrentType = stub(),
|
||||
getCurrentPath = stub(),
|
||||
} = {}) {
|
||||
function getDOM(overrides = {}) {
|
||||
const {
|
||||
link = {},
|
||||
getCurrentDirPath = stub(),
|
||||
getCurrentDirName = stub(),
|
||||
getByDataName = stub(),
|
||||
isContainClass = stub(),
|
||||
getCurrentType = stub(),
|
||||
getCurrentPath = stub(),
|
||||
} = overrides;
|
||||
|
||||
return {
|
||||
getCurrentDirPath,
|
||||
getCurrentDirName,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,11 @@ function _getModule(a) {
|
|||
return require(a);
|
||||
}
|
||||
|
||||
module.exports = (config, arg, {getModule = _getModule} = {}) => {
|
||||
module.exports = (config, arg, overrides = {}) => {
|
||||
const {
|
||||
getModule = _getModule,
|
||||
} = overrides;
|
||||
|
||||
if (!config('terminal'))
|
||||
return noop;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,12 @@ import {getThemes as _getThemes} from './theme.mjs';
|
|||
|
||||
const isString = (a) => typeof a === 'string';
|
||||
|
||||
export const root = (dir, config, {exit = _exit, statSync = _statSync} = {}) => {
|
||||
export const root = (dir, config, overrides = {}) => {
|
||||
const {
|
||||
exit = _exit,
|
||||
statSync = _statSync,
|
||||
} = overrides;
|
||||
|
||||
if (!isString(dir))
|
||||
throw Error('dir should be a string');
|
||||
|
||||
|
|
@ -36,7 +41,11 @@ export const packer = (name, {exit = _exit} = {}) => {
|
|||
exit('cloudcmd --packer: could be "tar" or "zip" only');
|
||||
};
|
||||
|
||||
export const columns = (type, {exit = _exit, getColumns = _getColumns} = {}) => {
|
||||
export const columns = (type, overrides = {}) => {
|
||||
const {
|
||||
exit = _exit,
|
||||
getColumns = _getColumns,
|
||||
} = overrides;
|
||||
const addQuotes = (a) => `"${a}"`;
|
||||
const all = Object
|
||||
.keys(getColumns())
|
||||
|
|
@ -51,7 +60,11 @@ export const columns = (type, {exit = _exit, getColumns = _getColumns} = {}) =>
|
|||
exit(`cloudcmd --columns: can be only one of: ${names}`);
|
||||
};
|
||||
|
||||
export const theme = (type, {exit = _exit, getThemes = _getThemes} = {}) => {
|
||||
export const theme = (type, overrides = {}) => {
|
||||
const {
|
||||
exit = _exit,
|
||||
getThemes = _getThemes,
|
||||
} = overrides;
|
||||
const addQuotes = (a) => `"${a}"`;
|
||||
const all = Object
|
||||
.keys(getThemes())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue