#!/bin/env python
#coding=utf-8
import os
import sys
import subprocess
import commands 

def checkUserIsROOTCommandline():
    if os.geteuid() != 0:
       print "This program must be run as root. Aborting."
       return False
       sys.exit(1)
    else:
       return True 

def startVSCodeIDE():
    rc,out = commands.getstatusoutput("code --user-data-dir=/home/config/Code/")
      #print ("VSCode Starting:\033[0;31m%s\033[0m" % out)
      #print ("VSCode Starting:\033[1;32m%s\033[0m" % "out")

def main():
    if True==checkUserIsROOTCommandline():
     # print checkUserIsROOTCommandline()
      startVSCodeIDE()

if __name__ == '__main__':
    main()

 

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐