Browse Source

Move wproj to git_wrapper namespace

pull/5/head
Ricardo Barbedo 6 years ago
parent
commit
01a6a3a693
3 changed files with 20 additions and 34 deletions
  1. +1
    -3
      Vivado_init.tcl
  2. +0
    -31
      scripts/alias.tcl
  3. +19
    -0
      scripts/git_wrapper.tcl

+ 1
- 3
Vivado_init.tcl View File

@ -5,6 +5,4 @@ namespace import ::custom_projutils::write_project_tcl_git
source $init_dir/scripts/git_wrapper.tcl source $init_dir/scripts/git_wrapper.tcl
namespace import ::git_wrapper::git namespace import ::git_wrapper::git
source $init_dir/scripts/alias.tcl
namespace import ::alias::wproj
namespace import ::git_wrapper::wproj

+ 0
- 31
scripts/alias.tcl View File

@ -1,31 +0,0 @@
# Aliases
# Interface
namespace eval ::alias {
namespace export wproj
namespace import ::custom_projutils::write_project_tcl_git
namespace import ::current_project
namespace import ::common::get_property
}
# Define
namespace eval ::alias {
proc wproj {} {
# Change directory project directory if not in it yet
set proj_dir [regsub {\/vivado_project$} [get_property DIRECTORY [current_project]] {}]
set current_dir [pwd]
if {
[string compare -nocase $proj_dir $current_dir]
} then {
puts "Not in project directory"
puts "Changing directory to: ${proj_dir}"
cd $proj_dir
}
# Generate project
set proj_file [current_project].tcl
puts $proj_file
write_project_tcl_git -no_copy_sources -force $proj_file
}
}

+ 19
- 0
scripts/git_wrapper.tcl View File

@ -11,6 +11,7 @@
namespace eval ::git_wrapper { namespace eval ::git_wrapper {
namespace export git namespace export git
namespace export wproj
namespace import ::custom_projutils::write_project_tcl_git namespace import ::custom_projutils::write_project_tcl_git
namespace import ::current_project namespace import ::current_project
namespace import ::common::get_property namespace import ::common::get_property
@ -59,4 +60,22 @@ namespace eval ::git_wrapper {
# Now commit everything # Now commit everything
exec git {*}$args exec git {*}$args
} }
proc wproj {} {
# Change directory project directory if not in it yet
set proj_dir [regsub {\/vivado_project$} [get_property DIRECTORY [current_project]] {}]
set current_dir [pwd]
if {
[string compare -nocase $proj_dir $current_dir]
} then {
puts "Not in project directory"
puts "Changing directory to: ${proj_dir}"
cd $proj_dir
}
# Generate project
set proj_file [current_project].tcl
puts $proj_file
write_project_tcl_git -no_copy_sources -force $proj_file
}
} }

Loading…
Cancel
Save