mirror of
https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials.git
synced 2024-11-03 15:40:21 +00:00
Conditionally include extra folders in utils scripts
This commit is contained in:
parent
2ce9a66aab
commit
e2e1c7d64c
@ -9,7 +9,7 @@ require 'fileutils'
|
||||
require_relative 'helpers/tutorial_folders.rb'
|
||||
|
||||
def diff_all
|
||||
crates = tutorial_folders
|
||||
crates = tutorial_folders(false)
|
||||
|
||||
(0..(crates.length - 2)).each do |i|
|
||||
old = File.dirname(crates[i])
|
||||
|
@ -7,11 +7,16 @@
|
||||
|
||||
require 'fileutils'
|
||||
|
||||
def tutorial_folders
|
||||
WITH_EXTRA = '[X0-9]'
|
||||
NO_EXTRA = '[0-9]'
|
||||
|
||||
def tutorial_folders(with_extra = true)
|
||||
crates = Dir['**/Cargo.toml']
|
||||
|
||||
crates.delete_if do |x|
|
||||
!/[0-9][0-9]/.match?(x[0..1])
|
||||
s = with_extra ? WITH_EXTRA : NO_EXTRA
|
||||
|
||||
!/[#{s}][0-9]/.match?(x[0..1])
|
||||
end
|
||||
|
||||
crates.sort!
|
||||
|
Loading…
Reference in New Issue
Block a user