From 01a6a3a6939582894750217fc6971e01e5dbb934 Mon Sep 17 00:00:00 2001 From: Ricardo Barbedo Date: Tue, 28 Nov 2017 21:28:23 +0100 Subject: [PATCH] Move wproj to git_wrapper namespace --- Vivado_init.tcl | 4 +--- scripts/alias.tcl | 31 ------------------------------- scripts/git_wrapper.tcl | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 34 deletions(-) delete mode 100755 scripts/alias.tcl diff --git a/Vivado_init.tcl b/Vivado_init.tcl index 2de7237..40f2148 100644 --- a/Vivado_init.tcl +++ b/Vivado_init.tcl @@ -5,6 +5,4 @@ namespace import ::custom_projutils::write_project_tcl_git source $init_dir/scripts/git_wrapper.tcl namespace import ::git_wrapper::git - -source $init_dir/scripts/alias.tcl -namespace import ::alias::wproj +namespace import ::git_wrapper::wproj diff --git a/scripts/alias.tcl b/scripts/alias.tcl deleted file mode 100755 index 077d027..0000000 --- a/scripts/alias.tcl +++ /dev/null @@ -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 - } -} diff --git a/scripts/git_wrapper.tcl b/scripts/git_wrapper.tcl index dd13cbc..2d54846 100644 --- a/scripts/git_wrapper.tcl +++ b/scripts/git_wrapper.tcl @@ -11,6 +11,7 @@ namespace eval ::git_wrapper { namespace export git + namespace export wproj namespace import ::custom_projutils::write_project_tcl_git namespace import ::current_project namespace import ::common::get_property @@ -59,4 +60,22 @@ namespace eval ::git_wrapper { # Now commit everything 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 + } }