瀏覽代碼

gitea addcollaborator support

pull/10/head
guest 2 年之前
父節點
當前提交
a443630508
共有 3 個檔案被更改,包括 4672 行新增4541 行删除
  1. 4649
    4533
      index.js
  2. 10
    3
      lin_verse.js
  3. 13
    5
      win_verse.js

+ 4649
- 4533
index.js
文件差異過大導致無法顯示
查看文件


+ 10
- 3
lin_verse.js 查看文件

@@ -135,14 +135,21 @@ var shell_verse = {
return Promise.resolve(false).then(( elevationstate ) => {
__isElevated ? console.log('Elevated') : console.log('Not Elevated')
__isElevated = elevationstate;
shell_verse.acquireElevationState = ()=> Promise.resolve(__isElevated);
shell_verse.isElevated = () => { return Promise.resolve(__isElevated)}
return __isElevated
}).catch(() => {
__isElevated = false;
console.log('Not Elevated');
}).finally(()=>{
shell_verse.acquireElevationState = ()=> Promise.resolve(__isElevated);
shell_verse.isElevated = () => { return Promise.resolve(__isElevated)}
return __isElevated;
console.log('Not Elevated');
return __isElevated
})
// .finally(()=>{
// shell_verse.acquireElevationState = ()=> Promise.resolve(__isElevated);
// shell_verse.isElevated = () => { return Promise.resolve(__isElevated)}
// return __isElevated; // Value returned from finally is not supported by node.
// })
}

, getTaskCheckExists : cli.createTask('getTaskCheckExists', 'which')

+ 13
- 5
win_verse.js 查看文件

@@ -1,5 +1,6 @@
const { any } = require('bbhverse');
const fs = require('fs')
var path = require('path');

var cli = require('./cliverse')
var nodeShellExec = cli.nodeShellExec;
@@ -138,14 +139,21 @@ var shell_verse = {
}).then((exitcode) => {
console.log('Elevated')
__isElevated = true;
}).catch(() => {
shell_verse.acquireElevationState = ()=> Promise.resolve(__isElevated);
shell_verse.isElevated = () => { return Promise.resolve(__isElevated)}
return __isElevated
}).catch((e) => {
__isElevated = false;
console.log('Not Elevated');
}).finally(()=>{
shell_verse.acquireElevationState = ()=> Promise.resolve(__isElevated);
shell_verse.isElevated = () => { return Promise.resolve(__isElevated)}
return __isElevated;
console.log('Not Elevated');
return __isElevated
})
// .finally(()=>{
// shell_verse.acquireElevationState = ()=> Promise.resolve(__isElevated);
// shell_verse.isElevated = () => { return Promise.resolve(__isElevated)}
// // return __isElevated; // Value returned from finally is not supported by node.
// })
}
, getTaskCheckExists : cli.createTask('getTaskCheckExists', 'where')
@@ -175,7 +183,7 @@ var shell_verse = {
console.log('result : ' + JSON.stringify(r))
Object.keys(processedArgs).forEach((v) => { v != '_' ? namedArgs.push('--' + v + '=' + processedArgs[v]) : null; })
// PB : TODO -- Convert all the cli args back to string.
var args = [`${selectedinstance.root}/.elxr/run-${taskToRun.runtimestamp}/windowselevate.hta`].concat(processedArgs._)
var args = [ path.normalize(`${selectedinstance.root}/.elxr/run-${taskToRun.runtimestamp}/windowselevate.hta`) ].concat(processedArgs._)
namedArgs.length > 0 ? args = args.concat(namedArgs.join(' ')) : null;
args.push('--runas=self');
var elevatedruntimestamp = (new Date()).getTime()

Loading…
取消
儲存