create path when parent of file to be written does not exist
+ usage for frappy command
This commit is contained in:
@@ -312,6 +312,7 @@ def write_when_new(filename, content, as_root=False, ignore_reduction=False):
|
||||
return False
|
||||
if doit:
|
||||
if lines:
|
||||
Path(filename).parent.mkdir(parents=True, exist_ok=True)
|
||||
with tempfile.NamedTemporaryFile('w') as fil:
|
||||
fil.write(content)
|
||||
fil.flush()
|
||||
|
||||
@@ -10,7 +10,11 @@ pathadd ~/.local/bin
|
||||
pathadd ~/frappy/bin
|
||||
|
||||
frappy() {
|
||||
systemctl --user $1 frappy
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Usage: frappy status|start|stop|restart"
|
||||
else
|
||||
systemctl --user $1 frappy
|
||||
fi
|
||||
}
|
||||
|
||||
boxweb() {
|
||||
|
||||
Reference in New Issue
Block a user