1#!/usr/bin/env python 2# -*- coding: utf-8 -*- 3# Copyright (c) 2011 The Chromium Authors. All rights reserved. 4 5# Use of this source code is governed by a BSD-style license that can be 6# found in the LICENSE file. 7"""Writes True if the argument is a directory.""" 8 9import os.path 10import sys 11 12 13def main(): 14 sys.stdout.write(_is_dir(sys.argv[1])) 15 return 0 16 17 18def _is_dir(dir_name): 19 return str(os.path.isdir(dir_name)) 20 21 22def DoMain(args): 23 """Hook to be called from gyp without starting a separate python 24 interpreter.""" 25 return _is_dir(args[0]) 26 27 28if __name__ == '__main__': 29 sys.exit(main()) 30