本文整理汇总了TypeScript中@es-git/terminal.log函数的典型用法代码示例。如果您正苦于以下问题:TypeScript log函数的具体用法?TypeScript log怎么用?TypeScript log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: eventChannel
export default function* withProgress<T>(terminal : Terminal, start : (emit : (v : string) => void) => Promise<T>){
const channel = yield eventChannel(emit => {
start(throttle(200, emit)).then(emit, emit);
return () => {};
});
while(true){
const message : StringOrResult = yield take(channel);
if(typeof(message) === 'string'){
yield put(gitProgressMessage(terminal.log(message)));
}else{
return message;
}
}
}
示例2: push
function* push(user : OauthData, components : string[]){
var terminal = new Terminal();
try{
yield put(gitProgressStatus('busy'));
yield put(gitProgressMessage(terminal.logLine(`Pushing...`)));
yield put(showPopup('GitProgress'));
yield* withProgress(terminal, emit => storage.push(user, components, emit));
yield put(gitProgressStatus('success'));
yield put(hidePopup());
}catch(e){
terminal.logLine();
yield put(gitProgressStatus('failure'));
yield put(gitProgressMessage(terminal.log(e.message)));
console.error(e);
}
}
示例3: fetch
function* fetch(){
var terminal = new Terminal();
try{
yield put(gitProgressStatus('busy'));
yield put(gitProgressMessage(terminal.logLine(`Fetching...`)));
yield put(showPopup('GitProgress'));
yield* withProgress(terminal, emit => storage.fetch(emit));
yield put(gitProgressStatus('success'));
yield put(hidePopup());
}catch(e){
terminal.logLine();
yield put(gitProgressStatus('failure'));
yield put(gitProgressMessage(terminal.log(e.message)));
console.error(e);
}
}
示例4: pull
function* pull(repo : string, name : string, hash? : string){
var terminal = new Terminal();
try{
yield put(gitProgressStatus('busy'));
yield put(gitProgressMessage(terminal.logLine(`Loading ${name}\nfrom ${repo}`)));
yield put(showPopup('GitProgress'));
yield* fetchWithProgress(repo, name, hash, terminal);
yield put(gitProgressStatus('success'));
yield put(hidePopup());
return yield storage.load(repo, name, hash);
}catch(e){
terminal.logLine();
yield put(gitProgressStatus('failure'));
yield put(gitProgressMessage(terminal.log(e.message)));
throw e;
}
}
示例5:
await repo.push(`/proxy/${url}.git`, 'refs/heads/master', user, { progress: message => terminal.log(message) })