Skip to content

Commit

Permalink
Only language py and don't override requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthomas committed Jan 17, 2024
1 parent 7638ceb commit bef9bba
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions openc3/lib/openc3/utilities/cli_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,19 @@ def self.generate_target(args)
false
end

# If we're using Python create a requirements.txt and list it in the gemspec
File.open("requirements.txt", 'w') do |file|
file.puts "# Python dependencies"
end
gemspec_filename = Dir['*.gemspec'][0]
gemspec = File.read(gemspec_filename)
gemspec.gsub!('plugin.txt', 'plugin.txt requirements.txt')
File.write(gemspec_filename, gemspec)
if @@language == 'py'
# If we're using Python create a requirements.txt and list it in the gemspec
# However, don't write over an existing file they may have already created
unless File.exist?("requirements.txt")
File.open("requirements.txt", 'w') do |file|
file.puts "# Python dependencies"
end
end
gemspec_filename = Dir['*.gemspec'][0]
gemspec = File.read(gemspec_filename)
gemspec.gsub!('plugin.txt', 'plugin.txt requirements.txt')
File.write(gemspec_filename, gemspec)
end

# Add this target to plugin.txt
File.open("plugin.txt", 'a') do |file|
Expand Down

0 comments on commit bef9bba

Please sign in to comment.