This repository has been archived by the owner on Oct 22, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix broken namespaces and migrate entry point into new bin
- Loading branch information
Showing
42 changed files
with
219 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,52 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
require 'wpxf' | ||
require 'wpxf/cli/console' | ||
require 'wpxf/cli/banner' | ||
|
||
begin | ||
Slop.parse do |o| | ||
o.on '--version', 'print the version' do | ||
puts Wpxf.version | ||
exit | ||
end | ||
end | ||
rescue Slop::UnknownOption => e | ||
puts e.message | ||
exit | ||
end | ||
|
||
console = Wpxf::Cli::Console.new | ||
console.check_cache | ||
console.clear | ||
|
||
banner = Wpxf::Cli::Banner.new | ||
banner.display | ||
|
||
Dir.chdir(Dir.tmpdir) do | ||
temp_directories = Dir.glob('wpxf_*') | ||
unless temp_directories.empty? | ||
print '[!] '.yellow | ||
puts "#{temp_directories.length} temporary files were found that "\ | ||
'appear to no longer be needed.' | ||
print ' Would you like to remove these files? [y/n]: ' | ||
temp_directories.each { |d| FileUtils.rm_r(d) } if gets.chomp =~ /^y$/i | ||
puts | ||
end | ||
end | ||
|
||
found_env_var = false | ||
ENV.each do |name, value| | ||
next if name.casecmp('wpxf_env').zero? | ||
match = name.match(/^wpxf_(.+)/i) | ||
|
||
if match | ||
console.gset match.captures[0], value | ||
found_env_var = true | ||
end | ||
end | ||
|
||
puts if found_env_var | ||
console.start | ||
console.clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,4 @@ def self.change_stdout_sync(enabled) | |
end | ||
|
||
require_relative '../db/env' | ||
require 'wpxf/core' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.