[nostalgia] Add pybb tool to help with cross platform compatibility
This commit is contained in:
18
scripts/pybb
Normal file
18
scripts/pybb
Normal file
@ -0,0 +1,18 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
def mkdir(path):
|
||||
if not os.path.exists(path) and os.path.isdir(path):
|
||||
os.mkdir(path)
|
||||
|
||||
def rm(path):
|
||||
if os.path.exists(path) or os.path.islink(path):
|
||||
os.remove(path)
|
||||
|
||||
if sys.argv[1] == 'mkdir':
|
||||
mkdir(sys.argv[2])
|
||||
elif sys.argv[1] == 'rm':
|
||||
for i in range(2, len(sys.argv)):
|
||||
rm(sys.argv[i])
|
Reference in New Issue
Block a user