rust-raspberrypi-OS-tutorials/utils/clean_all.rb

26 lines
524 B
Ruby
Raw Normal View History

#!/usr/bin/env ruby
2019-09-20 13:11:22 +00:00
# frozen_string_literal: true
2019-10-08 07:14:16 +00:00
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2018-2019 Andre Richter <andre.o.richter@gmail.com>
require 'fileutils'
2019-09-20 13:11:22 +00:00
require_relative 'helpers/tutorial_folders.rb'
2018-12-29 23:20:24 +00:00
def clean_all
2019-10-17 19:49:38 +00:00
crates = tutorial_folders
2019-10-17 19:49:38 +00:00
crates.each do |x|
x = File.dirname(x)
Dir.chdir(x) do
puts "Cleaning #{x}"
system('rm -rf target') || exit(1)
end
end
2018-12-29 23:20:24 +00:00
2019-10-17 19:49:38 +00:00
FileUtils.rm_rf('xbuild_sysroot')
end
clean_all if $PROGRAM_NAME == __FILE__