#!/usr/bin/env python3

import os
import sys
import shutil


def main(args):
    if args[0] == "checkbox":
        share_dir = "/usr/share/checkbox/scripts"
        lib_dir = "../../lib/checkbox/bin"
        if os.path.isdir(share_dir) and not os.path.islink(share_dir):
            shutil.rmtree(share_dir)
            os.symlink(lib_dir, share_dir)


if __name__ == "__main__":
    main(sys.argv[1:])
