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
|
run: redrun lint
|
||||||
- name: Build
|
- name: Build
|
||||||
id: build
|
id: build
|
||||||
run: >
|
run: |
|
||||||
redrun build
|
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
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
|
|
|
||||||
|
|
@ -74,13 +74,14 @@ function CloudCmdProto(DOM) {
|
||||||
right: 'asc',
|
right: 'asc',
|
||||||
};
|
};
|
||||||
|
|
||||||
this.changeDir = async (path, {
|
this.changeDir = async (path, overrides = {}) => {
|
||||||
isRefresh,
|
const {
|
||||||
panel,
|
isRefresh,
|
||||||
history = true,
|
panel,
|
||||||
noCurrent,
|
history = true,
|
||||||
currentName,
|
noCurrent,
|
||||||
} = {}) => {
|
currentName,
|
||||||
|
} = overrides;
|
||||||
const refresh = isRefresh;
|
const refresh = isRefresh;
|
||||||
let panelChanged;
|
let panelChanged;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -285,15 +285,17 @@ test('current-file: parseHrefAttribute', (t) => {
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
|
|
||||||
function getDOM({
|
function getDOM(overrides = {}) {
|
||||||
link = {},
|
const {
|
||||||
getCurrentDirPath = stub(),
|
link = {},
|
||||||
getCurrentDirName = stub(),
|
getCurrentDirPath = stub(),
|
||||||
getByDataName = stub(),
|
getCurrentDirName = stub(),
|
||||||
isContainClass = stub(),
|
getByDataName = stub(),
|
||||||
getCurrentType = stub(),
|
isContainClass = stub(),
|
||||||
getCurrentPath = stub(),
|
getCurrentType = stub(),
|
||||||
} = {}) {
|
getCurrentPath = stub(),
|
||||||
|
} = overrides;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
getCurrentDirPath,
|
getCurrentDirPath,
|
||||||
getCurrentDirName,
|
getCurrentDirName,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,11 @@ function _getModule(a) {
|
||||||
return require(a);
|
return require(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = (config, arg, {getModule = _getModule} = {}) => {
|
module.exports = (config, arg, overrides = {}) => {
|
||||||
|
const {
|
||||||
|
getModule = _getModule,
|
||||||
|
} = overrides;
|
||||||
|
|
||||||
if (!config('terminal'))
|
if (!config('terminal'))
|
||||||
return noop;
|
return noop;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,12 @@ import {getThemes as _getThemes} from './theme.mjs';
|
||||||
|
|
||||||
const isString = (a) => typeof a === 'string';
|
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))
|
if (!isString(dir))
|
||||||
throw Error('dir should be a string');
|
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');
|
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 addQuotes = (a) => `"${a}"`;
|
||||||
const all = Object
|
const all = Object
|
||||||
.keys(getColumns())
|
.keys(getColumns())
|
||||||
|
|
@ -51,7 +60,11 @@ export const columns = (type, {exit = _exit, getColumns = _getColumns} = {}) =>
|
||||||
exit(`cloudcmd --columns: can be only one of: ${names}`);
|
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 addQuotes = (a) => `"${a}"`;
|
||||||
const all = Object
|
const all = Object
|
||||||
.keys(getThemes())
|
.keys(getThemes())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue