Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(621)

Unified Diff: mojo/public/tools/prepend.py

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/tools/ls.py ('k') | mojo/public/tools/pylib/gs.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/prepend.py
diff --git a/mojo/public/tools/prepend.py b/mojo/public/tools/prepend.py
deleted file mode 100755
index de70a82cf6cf0c5289dd5b081ee40fbe9b6bd502..0000000000000000000000000000000000000000
--- a/mojo/public/tools/prepend.py
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""
-Prepends a given file with a given line. This can be used to add a shebang line
-to a generated file.
-"""
-
-import optparse
-import os
-import shutil
-import sys
-
-
-def main():
- parser = optparse.OptionParser()
- parser.add_option('--input', help='The file to prepend the line to.')
- parser.add_option('--line', help='The line to be prepended.')
- parser.add_option('--output', help='The output file.')
-
- options, _ = parser.parse_args()
- input_path = options.input
- output_path = options.output
- line = options.line
-
- # Warning - this reads all of the input file into memory.
- with open(output_path, 'w') as output_file:
- output_file.write(line + '\n')
- with open(input_path, 'r') as input_file:
- shutil.copyfileobj(input_file, output_file)
-
-
-if __name__ == '__main__':
- sys.exit(main())
« no previous file with comments | « mojo/public/tools/ls.py ('k') | mojo/public/tools/pylib/gs.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698