mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-01-31 00:35:19 +01:00
committed by
GitHub
parent
031d5fdafe
commit
17800571fe
5
.changes/tauri-cli-admin.md
Normal file
5
.changes/tauri-cli-admin.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri.js": patch
|
||||
---
|
||||
|
||||
Prevent running the `dev` pipeline when running with administrator privileges.
|
||||
8
.github/workflows/core-lint-fmt.yml
vendored
8
.github/workflows/core-lint-fmt.yml
vendored
@@ -3,10 +3,10 @@ name: clippy and fmt check
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/core-lint-fmt.yml
|
||||
- ./tauri/**
|
||||
- ./tauri-utils/**
|
||||
- ./tauri-api/**
|
||||
- '.github/workflows/core-lint-fmt.yml'
|
||||
- './tauri/**'
|
||||
- './tauri-utils/**'
|
||||
- './tauri-api/**'
|
||||
|
||||
jobs:
|
||||
workspace_clippy_fmt_check:
|
||||
|
||||
4
.github/workflows/js-lint.yml
vendored
4
.github/workflows/js-lint.yml
vendored
@@ -3,8 +3,8 @@ name: eslint check
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/js-lint.yml
|
||||
- ./cli/tauri.js/**
|
||||
- '.github/workflows/js-lint.yml'
|
||||
- './cli/tauri.js/**'
|
||||
|
||||
jobs:
|
||||
eslint-check:
|
||||
|
||||
4
.github/workflows/test-bundler.yml
vendored
4
.github/workflows/test-bundler.yml
vendored
@@ -3,8 +3,8 @@ name: test bundler
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/test-bundler.yml
|
||||
- ./cli/tauri-bundler/**
|
||||
- '.github/workflows/test-bundler.yml'
|
||||
- './cli/tauri-bundler/**'
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
|
||||
|
||||
10
.github/workflows/test-core.yml
vendored
10
.github/workflows/test-core.yml
vendored
@@ -3,11 +3,11 @@ name: test core
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/test-core.yml
|
||||
- ./cli/**
|
||||
- ./tauri/**
|
||||
- ./tauri-api/**
|
||||
- ./tauri-utils/**
|
||||
- '.github/workflows/test-core.yml'
|
||||
- './cli/**'
|
||||
- './tauri/**'
|
||||
- './tauri-api/**'
|
||||
- './tauri-utils/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
|
||||
14
cli/tauri.js/.gitignore
vendored
14
cli/tauri.js/.gitignore
vendored
@@ -1,5 +1,7 @@
|
||||
# Webpack output
|
||||
# Build output
|
||||
/dist
|
||||
/api
|
||||
|
||||
|
||||
# Logs
|
||||
logs
|
||||
@@ -62,13 +64,3 @@ typings/
|
||||
debug.log
|
||||
package-lock.json
|
||||
.vscode/settings.json
|
||||
|
||||
#api
|
||||
api/*
|
||||
|
||||
# Tauri output
|
||||
bundle.json
|
||||
config.json
|
||||
|
||||
# rust compiled folders
|
||||
target
|
||||
|
||||
1
cli/tauri.js/scripts/is-admin.ps1
Normal file
1
cli/tauri.js/scripts/is-admin.ps1
Normal file
@@ -0,0 +1 @@
|
||||
[bool](([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match "S-1-5-32-544");
|
||||
@@ -2,6 +2,13 @@ import { TauriConfig } from 'types'
|
||||
import { merge } from 'webpack-merge'
|
||||
import Runner from '../runner'
|
||||
import getTauriConfig from '../helpers/tauri-config'
|
||||
import logger from '../helpers/logger'
|
||||
import chalk from 'chalk'
|
||||
import { platform } from 'os'
|
||||
import { resolve } from 'path'
|
||||
import { sync as spawnSync } from 'cross-spawn'
|
||||
|
||||
const error = logger('tauri:dev', chalk.red)
|
||||
|
||||
interface DevResult {
|
||||
promise: Promise<void>
|
||||
@@ -9,6 +16,15 @@ interface DevResult {
|
||||
}
|
||||
|
||||
module.exports = (config: TauriConfig): DevResult => {
|
||||
if (platform() === 'win32') {
|
||||
const child = spawnSync('powershell', [resolve(__dirname, '../../scripts/is-admin.ps1')])
|
||||
const response = String(child.output[1]).replace('\n', '').trim()
|
||||
if (response === 'True') {
|
||||
error('Administrator privileges detected. Tauri doesn\'t work when running as admin, see https://github.com/Boscop/web-view/issues/96')
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
const tauri = new Runner()
|
||||
const tauriConfig = getTauriConfig(
|
||||
merge(
|
||||
|
||||
Reference in New Issue
Block a user