mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
client: modules: command-line: migrate to ESM
This commit is contained in:
parent
dae57c3d20
commit
0d7b037ac2
5 changed files with 15 additions and 15 deletions
|
|
@ -705,7 +705,10 @@ export function getPackerExt(type) {
|
|||
|
||||
export async function goToDirectory(overrides = {}) {
|
||||
const {Dialog} = DOM;
|
||||
const {prompt = Dialog.prompt, changeDir = CloudCmd.changeDir} = overrides;
|
||||
const {
|
||||
prompt = Dialog.prompt,
|
||||
changeDir = CloudCmd.changeDir,
|
||||
} = overrides;
|
||||
|
||||
const msg = 'Go to directory:';
|
||||
const {dirPath} = CurrentInfo;
|
||||
|
|
|
|||
|
|
@ -84,4 +84,3 @@ const stubCurrentFile = (fns = {}) => {
|
|||
setCurrentName,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,15 @@
|
|||
'use strict';
|
||||
|
||||
/* global CloudCmd */
|
||||
CloudCmd.CommandLine = exports;
|
||||
import * as Dialog from '#dom/dialog';
|
||||
|
||||
const Dialog = require('#dom/dialog');
|
||||
export const init = () => {};
|
||||
|
||||
const noop = () => {};
|
||||
CloudCmd.CommandLine = {
|
||||
init,
|
||||
show,
|
||||
hide,
|
||||
};
|
||||
|
||||
module.exports.init = noop;
|
||||
|
||||
module.exports.show = show;
|
||||
module.exports.hide = hide;
|
||||
|
||||
async function show() {
|
||||
export async function show() {
|
||||
const [, cmd] = await Dialog.prompt('Command Line', '');
|
||||
const TERMINAL = '^(t|terminal)';
|
||||
|
||||
|
|
@ -32,4 +29,4 @@ async function show() {
|
|||
}
|
||||
}
|
||||
|
||||
function hide() {}
|
||||
export function hide() {}
|
||||
|
|
@ -6,6 +6,7 @@ const autoGlobals = require('auto-globals');
|
|||
const {stub} = require('@cloudcmd/stub');
|
||||
const {test: tape} = require('supertape');
|
||||
const test = autoGlobals(tape);
|
||||
|
||||
const {
|
||||
_initConfig,
|
||||
_viewHtml,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue