File tree Expand file tree Collapse file tree 1 file changed +35
-3
lines changed Expand file tree Collapse file tree 1 file changed +35
-3
lines changed Original file line number Diff line number Diff line change 1
1
set windows-shell := [" powershell.exe" , " -NoLogo" , " -Command" ]
2
2
set unstable := true
3
3
set script-interpreter := [' uv' , ' run' , ' --script' ]
4
+ set positional-arguments := true
4
5
5
6
export PYTHONPATH := source_directory ()
6
7
7
8
[private ]
8
9
default :
9
10
@ just --list --list-submodules
10
11
11
- # run the django admin
12
12
[script ]
13
- manage * COMMAND :
13
+ _ manage * COMMAND :
14
14
import os
15
15
import sys
16
16
import shlex
17
17
from pathlib import Path
18
18
from django.core import management
19
19
os .environ.setdefault(" DJANGO_SETTINGS_MODULE" , " tests.settings.base" )
20
- management.execute_from_command_line(sys.argv + shlex.split(' {{ COMMAND }} ' ))
20
+ management.execute_from_command_line([" just manage" , *shlex.split(" {{ COMMAND }} " )])
21
+
22
+ # run the django admin
23
+ manage * COMMAND :
24
+ #! / bin/ sh
25
+ ARGS_LIST=" "
26
+ for arg in " $@" ; do
27
+ case " $arg" in
28
+ *[[:space:]]*)
29
+ # Argument contains a space; wrap it in quotes.
30
+ ARGS_LIST=" ${ARGS_LIST} \"\' ${arg}\'\" "
31
+ ;;
32
+ *)
33
+ # No spaces, print as-is.
34
+ ARGS_LIST=" ${ARGS_LIST} ${arg}"
35
+ ;;
36
+ esac
37
+ done
38
+ eval " just _manage $ARGS_LIST"
39
+
40
+ # run the django admin
41
+ [windows ]
42
+ manage * COMMAND :
43
+ $ARGS_LIST = " "
44
+ foreach ($arg in $args) {
45
+ if ($arg -match " \s " ) {
46
+ $ARGS_LIST + = " " + ' "' + " '" + $arg + " '" + ' "'
47
+ }
48
+ else {
49
+ $ARGS_LIST + = " " + $arg
50
+ }
51
+ }
52
+ Invoke-Expression " just _manage $ARGS_LIST"
21
53
22
54
# install the uv package manager
23
55
[linux ]
You can’t perform that action at this time.
0 commit comments