nostalgia/scripts/pybb

19 lines
375 B
Python

#! /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])