@@ -112,7 +112,7 @@ func runRelease(ctx context.Context, cmd *cli.Command) error {
112112 if err != nil {
113113 return err
114114 }
115- if err = releaseLibrary (ctx , cfg , libConfg , libConfg . Output , lastTag , gitExe , googleapisDir ); err != nil {
115+ if err = releaseLibrary (ctx , cfg , libConfg , lastTag , gitExe , googleapisDir ); err != nil {
116116 return err
117117 }
118118 }
@@ -133,44 +133,44 @@ func releaseAll(ctx context.Context, cfg *config.Config, lastTag, gitExe, google
133133 if err != nil {
134134 return err
135135 }
136- if shouldRelease (library , filesChanged , library . Output ) {
137- if err := releaseLibrary (ctx , cfg , library , library . Output , lastTag , gitExe , googleapisDir ); err != nil {
136+ if shouldRelease (library , filesChanged ) {
137+ if err := releaseLibrary (ctx , cfg , library , lastTag , gitExe , googleapisDir ); err != nil {
138138 return err
139139 }
140140 }
141141 }
142142 return nil
143143}
144144
145- func shouldRelease (library * config.Library , filesChanged []string , srcPath string ) bool {
145+ func shouldRelease (library * config.Library , filesChanged []string ) bool {
146146 if library .SkipPublish {
147147 return false
148148 }
149- pathWithTrailingSlash := srcPath
149+ pathWithTrailingSlash := library . Output
150150 if ! strings .HasSuffix (pathWithTrailingSlash , "/" ) {
151151 pathWithTrailingSlash = pathWithTrailingSlash + "/"
152152 }
153153 for _ , path := range filesChanged {
154- if strings .Contains (path , pathWithTrailingSlash ) {
154+ if strings .HasPrefix (path , pathWithTrailingSlash ) {
155155 return true
156156 }
157157 }
158158 return false
159159}
160160
161- func releaseLibrary (ctx context.Context , cfg * config.Config , libConfig * config.Library , srcPath , lastTag , gitExe , googleapisDir string ) error {
161+ func releaseLibrary (ctx context.Context , cfg * config.Config , libConfig * config.Library , lastTag , gitExe , googleapisDir string ) error {
162162 switch cfg .Language {
163163 case languageFake :
164164 return fakeReleaseLibrary (libConfig )
165165 case languageRust :
166- release , err := rust .ManifestVersionNeedsBump (gitExe , lastTag , srcPath + "/Cargo.toml" )
166+ release , err := rust .ManifestVersionNeedsBump (gitExe , lastTag , libConfig . Output + "/Cargo.toml" )
167167 if err != nil {
168168 return err
169169 }
170170 if ! release {
171171 return nil
172172 }
173- if err := rust .ReleaseLibrary (libConfig , srcPath ); err != nil {
173+ if err := rust .ReleaseLibrary (libConfig ); err != nil {
174174 return err
175175 }
176176 copyConfig , err := cloneConfig (cfg )
0 commit comments