mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
fix: tests/x.py doesn't need to worry about user permissions on windows
This commit is contained in:
parent
994911b1fe
commit
884b523d43
13
tests/x.py
13
tests/x.py
@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env python
|
||||
import subprocess
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import argparse
|
||||
import getpass
|
||||
from glob import glob
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
@ -64,12 +64,19 @@ def run(command, comment=None, env=None, service=None, tag=None, args=None):
|
||||
|
||||
print(f"\x1b[93m $ {command} {' '.join(command_args)}\x1b[0m")
|
||||
|
||||
# try and rebind the user by id
|
||||
# this only matters on *nix
|
||||
|
||||
try:
|
||||
user = ["--user", f"{os.getuid()}:{os.getgid()}"]
|
||||
except: # noqa
|
||||
user = []
|
||||
|
||||
res = subprocess.run(
|
||||
[
|
||||
"docker-compose",
|
||||
"run",
|
||||
"--user",
|
||||
f"{os.getuid()}:{os.getgid()}",
|
||||
*user,
|
||||
"--rm",
|
||||
*environ,
|
||||
"sqlx",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user